Skip to content

[SPARK-56528][CORE] Make Jetty SniHostCheck configurable#55396

Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:dongjoon/pensive-hugle-48097c
Closed

[SPARK-56528][CORE] Make Jetty SniHostCheck configurable#55396
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:dongjoon/pensive-hugle-48097c

Conversation

@dongjoon-hyun
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun commented Apr 17, 2026

What changes were proposed in this pull request?

As a part of SPARK-55556: Improve Web Security, this PR introduces a new configuration spark.ui.jetty.sniHostCheckEnabled that controls Jetty's SNI host check on the Spark UI HTTPS connector. sniHostCheck is recommended by Jetty community as we can see that the default value of Jetty is true already. The previously Spark-side hardcoded SecureRequestCustomizer.setSniHostCheck(false) call in JettyUtils is replaced with a value driven by this configuration.

The default value is false, preserving the existing behavior introduced in SPARK-45522.

Why are the changes needed?

In the Jetty usage, jetty.ssl.sniHostCheck=false is supposed to override the default behavior. However, since SPARK-45522 (Jetty 10+), Spark has set SniHostCheck to false strictly to preserve backward compatibility with standalone deployments. Operators who want stricter host checking for security have no way to enable it without patching source. Exposing this as a configuration lets users opt in to SNI host checking when desired.

Does this PR introduce any user-facing change?

No. A new configuration spark.ui.jetty.sniHostCheckEnabled (default: false) is added in Spark 4.2.0. The default preserves the current behavior, so existing deployments are unaffected.

How was this patch tested?

Pass the CIs.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-XXXXX][UI] Make Jetty SniHostCheck configurable [SPARK-56528][UI] Make Jetty SniHostCheck configurable Apr 17, 2026
@dongjoon-hyun dongjoon-hyun force-pushed the dongjoon/pensive-hugle-48097c branch from 2ef1608 to 92b5438 Compare April 17, 2026 18:14
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-56528][UI] Make Jetty SniHostCheck configurable [SPARK-56528][CORE] Make Jetty SniHostCheck configurable Apr 17, 2026
@dongjoon-hyun dongjoon-hyun force-pushed the dongjoon/pensive-hugle-48097c branch from 92b5438 to e04e114 Compare April 17, 2026 23:19
@dongjoon-hyun
Copy link
Copy Markdown
Member Author

Thank you, @HyukjinKwon ~ Merged to master for Apache Spark 4.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants