From 59809f6e43c1a4bd0ebffd7c781d560e7050b685 Mon Sep 17 00:00:00 2001 From: HiuFung Kwok Date: Tue, 7 Nov 2023 17:18:32 +0800 Subject: [PATCH] SPARK-45522: Updat ssl server changes --- core/src/main/scala/org/apache/spark/SSLOptions.scala | 2 +- core/src/main/scala/org/apache/spark/ui/JettyUtils.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/SSLOptions.scala b/core/src/main/scala/org/apache/spark/SSLOptions.scala index 26108d885e4c7..ce058cec26866 100644 --- a/core/src/main/scala/org/apache/spark/SSLOptions.scala +++ b/core/src/main/scala/org/apache/spark/SSLOptions.scala @@ -87,7 +87,7 @@ private[spark] case class SSLOptions( /** * Creates a Jetty SSL context factory according to the SSL settings represented by this object. */ - def createJettySslContextFactory(): Option[SslContextFactory] = { + def createJettySslContextFactoryServer(): Option[SslContextFactory.Server] = { if (enabled) { val sslContextFactory = new SslContextFactory.Server() diff --git a/core/src/main/scala/org/apache/spark/ui/JettyUtils.scala b/core/src/main/scala/org/apache/spark/ui/JettyUtils.scala index aec0b6379b84f..a43d2b20cd80c 100644 --- a/core/src/main/scala/org/apache/spark/ui/JettyUtils.scala +++ b/core/src/main/scala/org/apache/spark/ui/JettyUtils.scala @@ -324,7 +324,7 @@ private[spark] object JettyUtils extends Logging { httpConfig.setSendXPoweredBy(false) // If SSL is configured, create the secure connector first. - val securePort = sslOptions.createJettySslContextFactory().map { factory => + val securePort = sslOptions.createJettySslContextFactoryServer().map { factory => val securePort = sslOptions.port.getOrElse(if (port > 0) Utils.userPort(port, 400) else 0) val secureServerName = if (serverName.nonEmpty) s"$serverName (HTTPS)" else serverName