Skip to content

Commit df69103

Browse files
[LIVY-1012] Use SslContextFactory.Server() instead of SslContextFactory
## What changes were proposed in this pull request? Use SslContextFactory.Server() instead of SslContextFactory() when constructing the factory. ## How was this patch tested? With Jetty 9.4.50, we should call SslContextFactory.Server(), instead of SslContextFactory(), to create SslContextFactory. Otherwise we get the following error when using a KeyStore with multiple certificates in it. ``` Exception in thread "main" java.lang.IllegalStateException: KeyStores with multiple certificates are not supported on the base class org.eclipse.jetty.util.ssl.SslContextFactory. (Use org.eclipse.jetty.util.ssl. SslContextFactory$Server or org.eclipse.jetty.util.ssl.SslContextFactory$Client instead) at org.eclipse.jetty.util.ssl.SslContextFactory.newSniX509ExtendedKeyManager(SslContextFactory.java:1289) ```
1 parent f580e71 commit df69103

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/scala/org/apache/livy/server/WebServer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class WebServer(livyConf: LivyConf, var host: String, var port: Int) extends Log
4949
https.setSendServerVersion(livyConf.getBoolean(LivyConf.SEND_SERVER_VERSION))
5050
https.addCustomizer(new SecureRequestCustomizer())
5151

52-
val sslContextFactory = new SslContextFactory()
52+
val sslContextFactory = new SslContextFactory.Server()
5353
sslContextFactory.setKeyStorePath(keystore)
5454

5555
val credentialProviderPath = livyConf.get(LivyConf.HADOOP_CREDENTIAL_PROVIDER_PATH)

thriftserver/server/src/main/scala/org/apache/livy/thriftserver/cli/ThriftHttpCLIService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ThriftHttpCLIService(
8989
}
9090
val keyStorePassword = getKeyStorePassword()
9191
val keystoreType = livyConf.get(LivyConf.SSL_KEYSTORE_TYPE)
92-
val sslContextFactory = new SslContextFactory
92+
val sslContextFactory = new SslContextFactory.Server();
9393
val excludedProtocols = livyConf.get(LivyConf.THRIFT_SSL_PROTOCOL_BLACKLIST).split(",")
9494
info(s"HTTP Server SSL: adding excluded protocols: $excludedProtocols")
9595
sslContextFactory.addExcludeProtocols(excludedProtocols: _*)

0 commit comments

Comments
 (0)