You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by su...@apache.org on 2023/11/08 16:10:12 UTC

(hive) branch master updated: HIVE-27817: Disable ssl hostname verification for 127.0.0.1 (#4823)

This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 2eef89b5b6f HIVE-27817: Disable ssl hostname verification for 127.0.0.1 (#4823)
2eef89b5b6f is described below

commit 2eef89b5b6f350c2c9a72499c3253760df20a328
Author: Yuming Wang <yu...@ebay.com>
AuthorDate: Thu Nov 9 00:10:04 2023 +0800

    HIVE-27817: Disable ssl hostname verification for 127.0.0.1 (#4823)
---
 .../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 a37d527c1ea..68163afa42b 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
@@ -142,7 +142,11 @@ public class HiveAuthUtils {
       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);
     TSocket tSocket = new TSocket(sslSocket);
     return configureThriftMaxMessageSize(tSocket, maxMessageSize);