You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "cgivre (via GitHub)" <gi...@apache.org> on 2023/04/23 19:23:23 UTC

[GitHub] [calcite] cgivre commented on a diff in pull request #3174: CALCITE-5671: Add Option to Disable SSL Certificate Validation to ES Adapter

cgivre commented on code in PR #3174:
URL: https://github.com/apache/calcite/pull/3174#discussion_r1174631103


##########
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchemaFactory.java:
##########
@@ -173,6 +187,16 @@
                 httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
           }
 
+          if (disableSSLVerification) {
+            SSLContext sslContext = SSLContext.getInstance("TLS");
+            sslContext.init(null, new TrustManager[] { UnsafeX509ExtendedTrustManager.INSTANCE },
+                null);
+
+            builder.setHttpClientConfigCallback(httpClientBuilder ->
+                httpClientBuilder.setSSLContext(sslContext)
+                    .setSSLHostnameVerifier((host, session) -> true));

Review Comment:
   This is a deliberate option for development servers.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org