From 895af34271485c173a81768cb33edd26909709d6 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Sun, 7 Jul 2019 18:57:31 -0700 Subject: [PATCH] [SPARK-28290][CORE][SQL] Use `SslContextFactory.Server` instead of `SslContextFactory` --- core/src/main/scala/org/apache/spark/SSLOptions.scala | 2 +- .../apache/hive/service/cli/thrift/ThriftHttpCLIService.java | 2 +- .../apache/hive/service/cli/thrift/ThriftHttpCLIService.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/SSLOptions.scala b/core/src/main/scala/org/apache/spark/SSLOptions.scala index 1632e0c69eef..446a8e5eba73 100644 --- a/core/src/main/scala/org/apache/spark/SSLOptions.scala +++ b/core/src/main/scala/org/apache/spark/SSLOptions.scala @@ -68,7 +68,7 @@ private[spark] case class SSLOptions( */ def createJettySslContextFactory(): Option[SslContextFactory] = { if (enabled) { - val sslContextFactory = new SslContextFactory() + val sslContextFactory = new SslContextFactory.Server() keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath)) keyStorePassword.foreach(sslContextFactory.setKeyStorePassword) diff --git a/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java index c3bcaf1e2d6c..504e63dbc5e5 100644 --- a/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java +++ b/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java @@ -86,7 +86,7 @@ public void run() { throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + " Not configured for SSL connection"); } - SslContextFactory sslContextFactory = new SslContextFactory(); + SslContextFactory sslContextFactory = new SslContextFactory.Server(); String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); sslContextFactory.addExcludeProtocols(excludedProtocols); diff --git a/sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java index 003898acf598..08626e7eb146 100644 --- a/sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java +++ b/sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java @@ -87,7 +87,7 @@ public void run() { throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + " Not configured for SSL connection"); } - SslContextFactory sslContextFactory = new SslContextFactory(); + SslContextFactory sslContextFactory = new SslContextFactory.Server(); String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); sslContextFactory.addExcludeProtocols(excludedProtocols);