stalary commented on a change in pull request #5325:
URL: https://github.com/apache/incubator-doris/pull/5325#discussion_r608655665
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/EsRestClient.java
##########
@@ -207,4 +240,33 @@ private String execute(String path) throws
DorisEsException {
}
return (T) (key != null ? map.get(key) : map);
}
+
+ /**
+ * support https
+ **/
+ private static class TrustAllCerts implements X509TrustManager {
+ public void checkClientTrusted(X509Certificate[] chain, String
authType) throws CertificateException {}
+
+ public void checkServerTrusted(X509Certificate[] chain, String
authType) throws CertificateException {}
+
+ public X509Certificate[] getAcceptedIssuers() {return new
X509Certificate[0];}
+ }
+
+ private static class TrustAllHostnameVerifier implements HostnameVerifier {
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ }
+
+ private static SSLSocketFactory createSSLSocketFactory() {
+ SSLSocketFactory ssfFactory;
+ try {
+ SSLContext sc = SSLContext.getInstance("TLS");
+ sc.init(null, new TrustManager[]{new TrustAllCerts()}, new
SecureRandom());
+ ssfFactory = sc.getSocketFactory();
+ } catch (Exception e) {
+ throw new DorisEsException("createSSLSocketFactory error");
Review comment:
DorisEsException not support input exception
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]