Skip to content

Commit a6506f0

Browse files
committed
[SPARK-28290][CORE][SQL] Use SslContextFactory.Server instead of SslContextFactory
## What changes were proposed in this pull request? `SslContextFactory` is deprecated at Jetty 9.4 and we are using `9.4.18.v20190429`. This PR aims to replace it with `SslContextFactory.Server`. - https://www.eclipse.org/jetty/javadoc/9.4.19.v20190610/org/eclipse/jetty/util/ssl/SslContextFactory.html - https://www.eclipse.org/jetty/javadoc/9.3.24.v20180605/org/eclipse/jetty/util/ssl/SslContextFactory.html ``` [WARNING] /Users/dhyun/APACHE/spark/core/src/main/scala/org/apache/spark/SSLOptions.scala:71: constructor SslContextFactory in class SslContextFactory is deprecated: see corresponding Javadoc for more information. [WARNING] val sslContextFactory = new SslContextFactory() [WARNING] ^ ``` ## How was this patch tested? Pass the Jenkins with the existing tests. Closes apache#25067 from dongjoon-hyun/SPARK-28290. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent b89c3de commit a6506f0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

core/src/main/scala/org/apache/spark/SSLOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private[spark] case class SSLOptions(
6868
*/
6969
def createJettySslContextFactory(): Option[SslContextFactory] = {
7070
if (enabled) {
71-
val sslContextFactory = new SslContextFactory()
71+
val sslContextFactory = new SslContextFactory.Server()
7272

7373
keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
7474
keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)

sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void run() {
8686
throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname
8787
+ " Not configured for SSL connection");
8888
}
89-
SslContextFactory sslContextFactory = new SslContextFactory();
89+
SslContextFactory sslContextFactory = new SslContextFactory.Server();
9090
String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",");
9191
LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols));
9292
sslContextFactory.addExcludeProtocols(excludedProtocols);

sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void run() {
8787
throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname
8888
+ " Not configured for SSL connection");
8989
}
90-
SslContextFactory sslContextFactory = new SslContextFactory();
90+
SslContextFactory sslContextFactory = new SslContextFactory.Server();
9191
String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",");
9292
LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols));
9393
sslContextFactory.addExcludeProtocols(excludedProtocols);

0 commit comments

Comments
 (0)