This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-2.3 by this push:
new c1bfbd0f2cf HIVE-27817: Disable ssl hostname verification for
127.0.0.1 (#4823) (#4865)
c1bfbd0f2cf is described below
commit c1bfbd0f2cf3a52796601e376fa37e09a6fe6556
Author: Yuming Wang <[email protected]>
AuthorDate: Fri Nov 24 00:08:26 2023 +0800
HIVE-27817: Disable ssl hostname verification for 127.0.0.1 (#4823) (#4865)
(cherry picked from commit 2eef89b5b6f350c2c9a72499c3253760df20a328)
---
.../src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java
b/common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java
index e12f2458712..632980e7cd8 100644
--- a/common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java
+++ b/common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java
@@ -71,7 +71,11 @@ public class HiveAuthUtils {
private static TSocket getSSLSocketWithHttps(TSocket tSSLSocket) throws
TTransportException {
SSLSocket sslSocket = (SSLSocket) tSSLSocket.getSocket();
SSLParameters sslParams = sslSocket.getSSLParameters();
- sslParams.setEndpointIdentificationAlgorithm("HTTPS");
+ if (sslSocket.getLocalAddress().getHostAddress().equals("127.0.0.1")) {
+ sslParams.setEndpointIdentificationAlgorithm(null);
+ } else {
+ sslParams.setEndpointIdentificationAlgorithm("HTTPS");
+ }
sslSocket.setSSLParameters(sslParams);
return new TSocket(sslSocket);
}