{"record":{"id":"455d11ccb2bc1627","repo":"apache/druid","slug":"failed-to-build-sslcontext","errorCode":null,"errorMessage":"Failed to build SSLContext","messagePattern":"Failed to build SSLContext","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulClients.java","lineNumber":137,"sourceCode":"    try {\n      return new TLSUtils.ClientSSLContextBuilder()\n          .setProtocol(config.getProtocol())\n          .setTrustStoreType(config.getTrustStoreType())\n          .setTrustStorePath(config.getTrustStorePath())\n          .setTrustStoreAlgorithm(config.getTrustStoreAlgorithm())\n          .setTrustStorePasswordProvider(config.getTrustStorePasswordProvider())\n          .setKeyStoreType(config.getKeyStoreType())\n          .setKeyStorePath(config.getKeyStorePath())\n          .setKeyStoreAlgorithm(config.getKeyManagerFactoryAlgorithm())\n          .setCertAlias(config.getCertAlias())\n          .setKeyStorePasswordProvider(config.getKeyStorePasswordProvider())\n          .setKeyManagerFactoryPasswordProvider(config.getKeyManagerPasswordProvider())\n          .setValidateHostnames(config.getValidateHostnames())\n          .build();\n    }\n    catch (Exception e) {\n      LOGGER.error(e, \"Failed to build SSLContext from ConsulSSLConfig\");\n      throw new IllegalStateException(\"Failed to build SSLContext\", e);\n    }\n  }\n\n  /**\n   * Create an HttpClient with the given SSLContext.\n   */\n  private static HttpClient createHttpClientWithOptionalBasicAuth(\n      SSLContext sslContext,\n      String basicUser,\n      String basicPass,\n      ConsulDiscoveryConfig.ConnectionConfig connection,\n      ConsulSSLConfig sslConfig\n  )\n  {\n    HttpClientBuilder httpBuilder = HttpClients.custom();\n\n    // Always use a PoolingHttpClientConnectionManager with proper pool sizing\n    // This prevents ConnectionPoolTimeoutException when multiple threads use the client concurrently","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulClients.java#L119-L155","documentation":"Wrapper failure in buildSslContext: the TLSUtils.ClientSSLContextBuilder threw while loading the configured truststore/keystore (missing file, wrong password, unsupported type/algorithm); the original exception is rethrown with this message.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulClients.java:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the cause: typically a missing or unreadable trustStorePath/keyStorePath, or a wrong store password.","Validate trustStoreType, protocol and algorithm values against the JVM's supported set."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}