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


##########
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/UnsafeX509ExtendedTrustManager.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.adapter.elasticsearch;
+
+import java.net.Socket;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.X509ExtendedTrustManager;
+
+/**
+ * This class is used to disable SSL Certificate Verification in 
ElasticSearch.  This trust
+ * manager will validate any SSL certificate, whether valid or not. This 
should <b>not</b> be
+ * used in production environments.
+ */
+@SuppressWarnings("java:S4830")
+public final class UnsafeX509ExtendedTrustManager extends 
X509ExtendedTrustManager {

Review Comment:
   I don't have a strong preference of this, currently it seems that only ES 
Adapter needs this, and I'm not sure if there will be more adapters that need 
this, so putting it in the util of core seems a little over-designed for me, we 
may could defer it to the next time that another adapter calls for it.
   
   Of course if somebody strongly supports this, and I'm fine with it. Then the 
class comment for `UnsafeX509ExtendedTrustManager` should be adapted to not 
only mention about ES.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to