-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-16987] [None] Add spark-default.conf property to define https port for spark history server #15652
[SPARK-16987] [None] Add spark-default.conf property to define https port for spark history server #15652
Changes from 4 commits
955a82c
8ac0369
47108b4
3964609
1e2c985
935415c
62aeb6c
bd945aa
9d69f02
30a2927
83df9bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,14 +308,22 @@ private[spark] object JettyUtils extends Logging { | |
|
||
sslOptions.createJettySslContextFactory().foreach { factory => | ||
// If the new port wraps around, do not try a privileged port. | ||
|
||
require(sslOptions.port == 0 || (1024 <= sslOptions.port && sslOptions.port < 65536)) | ||
|
||
val securePort = | ||
if (currentPort != 0) { | ||
(currentPort + 400 - 1024) % (65536 - 1024) + 1024 | ||
if (1024 < sslOptions.port && sslOptions.port < 65536) { | ||
sslOptions.port | ||
} else { | ||
(currentPort + 400 - 1024) % (65536 - 1024) + 1024 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment in the code explaining the math done here ? It will help readability of the code. |
||
} | ||
} else { | ||
0 | ||
} | ||
val scheme = "https" | ||
// Create a connector on port securePort to listen for HTTPS requests | ||
// Create a connector on port securePort to listen for HTTPS requests. | ||
|
||
val connector = new ServerConnector(server, factory) | ||
connector.setPort(securePort) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1598,7 +1598,7 @@ Apart from these, the following properties are also available, and may be useful | |
<td>false</td> | ||
<td> | ||
<p>Whether to enable SSL connections on all supported protocols.</p> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you can, remove this change |
||
<p>When <code>spark.ssl.enabled</code> is configured, <code>spark.ssl.protocol</code> | ||
is required.</p> | ||
|
||
|
@@ -1663,6 +1663,14 @@ Apart from these, the following properties are also available, and may be useful | |
page. | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>spark.ssl.<particular protocol>.port</code></td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree; see #15652 (comment) This should just refer to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has a reason for this.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are saying about following documentation at "spark.ssl.enabled", aren't you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's what I'm referring to. I would still use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I understood. I refered about attention, and changed the key to spark.ssl.port. |
||
<td>0</td> | ||
<td> | ||
Port number to listen on for SSL connections. | ||
Default value of 0 means the port will be determined automatically. | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>spark.ssl.needClientAuth</code></td> | ||
<td>false</td> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition should only happen when the port is 0 right? given the
require
above. It would be clearer to check against 0 only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
require()
above you have1024 <= sslOptions.port
but in thisif()
you have1024 < sslOptions.port
. Just wanted to check if thats intentional.