vvysotskyi commented on a change in pull request #2331: URL: https://github.com/apache/drill/pull/2331#discussion_r726523723
########## File path: contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java ########## @@ -116,6 +125,28 @@ private OkHttpClient setupHttpClient() { builder.writeTimeout(timeout, TimeUnit.SECONDS); builder.readTimeout(timeout, TimeUnit.SECONDS); + // Code to skip SSL Certificate validation + // Sourced from https://stackoverflow.com/questions/60110848/how-to-disable-ssl-verification + if (! scanDefn.tableSpec().connectionConfig().verifySSLCert()) { + try { + TrustManager[] trustAllCerts = getAllTrustingTrustManager(); + SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(null, trustAllCerts, new java.security.SecureRandom()); + SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); + + + builder.sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]); + builder.hostnameVerifier(new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); Review comment: Can we use lambda here instead of declaring an anonymous class? ########## File path: contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpApiConfig.java ########## @@ -102,6 +102,8 @@ private final int xmlDataLevel; @JsonProperty private final boolean errorOn400; + @JsonProperty Review comment: Please add `@JsonInclude` annotation, since it wouldn't be possible to disable this property. -- 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: dev-unsubscr...@drill.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org