Skip to content
Snippets Groups Projects
Commit c329a568 authored by hayashidac's avatar hayashidac Committed by Kousuke Saruta
Browse files

[SPARK-16988][SPARK SHELL] spark history server log needs to be fixed to show...

[SPARK-16988][SPARK SHELL] spark history server log needs to be fixed to show https url when ssl is enabled

spark history server log needs to be fixed to show https url when ssl is enabled

Author: chie8842 <chie@chie-no-Mac-mini.local>

Closes #15611 from hayashidac/SPARK-16988.
parent 2c7394ad
No related branches found
No related tags found
No related merge requests found
...@@ -147,7 +147,10 @@ private[spark] abstract class WebUI( ...@@ -147,7 +147,10 @@ private[spark] abstract class WebUI(
} }
/** Return the url of web interface. Only valid after bind(). */ /** Return the url of web interface. Only valid after bind(). */
def webUrl: String = s"http://$publicHostName:$boundPort" def webUrl: String = {
val protocol = if (sslOptions.enabled) "https" else "http"
s"$protocol://$publicHostName:$boundPort"
}
/** Return the actual port to which this server is bound. Only valid after bind(). */ /** Return the actual port to which this server is bound. Only valid after bind(). */
def boundPort: Int = serverInfo.map(_.boundPort).getOrElse(-1) def boundPort: Int = serverInfo.map(_.boundPort).getOrElse(-1)
......
...@@ -79,7 +79,7 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll { ...@@ -79,7 +79,7 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
conf.set("spark.ssl.protocol", "SSLv3") conf.set("spark.ssl.protocol", "SSLv3")
val defaultOpts = SSLOptions.parse(conf, "spark.ssl", defaults = None) val defaultOpts = SSLOptions.parse(conf, "spark.ssl", defaults = None)
val opts = SSLOptions.parse(conf, "spark.ui.ssl", defaults = Some(defaultOpts)) val opts = SSLOptions.parse(conf, "spark.ssl.ui", defaults = Some(defaultOpts))
assert(opts.enabled === true) assert(opts.enabled === true)
assert(opts.trustStore.isDefined === true) assert(opts.trustStore.isDefined === true)
...@@ -102,20 +102,20 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll { ...@@ -102,20 +102,20 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
val conf = new SparkConf val conf = new SparkConf
conf.set("spark.ssl.enabled", "true") conf.set("spark.ssl.enabled", "true")
conf.set("spark.ui.ssl.enabled", "false") conf.set("spark.ssl.ui.enabled", "false")
conf.set("spark.ssl.keyStore", keyStorePath) conf.set("spark.ssl.keyStore", keyStorePath)
conf.set("spark.ssl.keyStorePassword", "password") conf.set("spark.ssl.keyStorePassword", "password")
conf.set("spark.ui.ssl.keyStorePassword", "12345") conf.set("spark.ssl.ui.keyStorePassword", "12345")
conf.set("spark.ssl.keyPassword", "password") conf.set("spark.ssl.keyPassword", "password")
conf.set("spark.ssl.trustStore", trustStorePath) conf.set("spark.ssl.trustStore", trustStorePath)
conf.set("spark.ssl.trustStorePassword", "password") conf.set("spark.ssl.trustStorePassword", "password")
conf.set("spark.ssl.enabledAlgorithms", conf.set("spark.ssl.enabledAlgorithms",
"TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA") "TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA")
conf.set("spark.ui.ssl.enabledAlgorithms", "ABC, DEF") conf.set("spark.ssl.ui.enabledAlgorithms", "ABC, DEF")
conf.set("spark.ssl.protocol", "SSLv3") conf.set("spark.ssl.protocol", "SSLv3")
val defaultOpts = SSLOptions.parse(conf, "spark.ssl", defaults = None) val defaultOpts = SSLOptions.parse(conf, "spark.ssl", defaults = None)
val opts = SSLOptions.parse(conf, "spark.ui.ssl", defaults = Some(defaultOpts)) val opts = SSLOptions.parse(conf, "spark.ssl.ui", defaults = Some(defaultOpts))
assert(opts.enabled === false) assert(opts.enabled === false)
assert(opts.trustStore.isDefined === true) assert(opts.trustStore.isDefined === true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment