You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yadavay-amzn (via GitHub)" <gi...@apache.org> on 2026/04/11 03:50:24 UTC
[PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
yadavay-amzn opened a new pull request, #55308:
URL: https://github.com/apache/spark/pull/55308
### What changes were proposed in this pull request?
Disable SNI host check in `ThriftHttpCLIService` by adding a `SecureRequestCustomizer` with `setSniHostCheck(false)` to the Jetty SSL connector configuration.
This is the same fix that was applied to `JettyUtils.scala` in SPARK-45522 when Spark upgraded from Jetty 9 to Jetty 10, but was missed for `ThriftHttpCLIService`.
### Why are the changes needed?
Since Jetty 10, `SniHostCheck` defaults to `true`. This was disabled in the Spark UI server (SPARK-45522) but not in `ThriftHttpCLIService`, which also creates a Jetty server with SSL support. Without this fix, the Hive Thrift HTTP server may reject HTTPS connections when the SNI hostname does not match the certificate.
**Note on `RestSubmissionServer`:** The JIRA also mentions `RestSubmissionServer`, but after reviewing the code, it has no SSL support — it only creates plain HTTP connectors. The SNI host check only applies to HTTPS, so `RestSubmissionServer` does not need this fix.
### Does this PR introduce _any_ user-facing change?
No. This restores the pre-Jetty 10 behavior where SNI host check was not enforced.
### How was this patch tested?
- `mvn install -pl sql/hive-thriftserver -am -DskipTests -Phive -Phive-thriftserver` compiles successfully with zero errors.
- The change follows the exact same pattern as the existing fix in `JettyUtils.scala` (lines 337-341).
### Was this patch authored or co-authored using generative AI tooling?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4418325506
Done — updated to follow the SPARK-56528 pattern. Added `spark.sql.hive.thriftServer.http.sniHostCheckEnabled` (default: `false`) so it's configurable rather than unconditionally disabled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4354897248
@LuciferYang Could you take a look when you get a chance? Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Make ThriftHttpCLIService SNI host check configurable [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on code in PR #55308:
URL: https://github.com/apache/spark/pull/55308#discussion_r3262112427
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/StaticSQLConf.scala:
##########
@@ -122,6 +122,17 @@ object StaticSQLConf {
.booleanConf
.createWithDefault(false)
+ val HIVE_THRIFT_SERVER_HTTP_SNI_HOST_CHECK_ENABLED =
+ buildStaticConf("spark.sql.hive.thriftServer.http.sniHostCheckEnabled")
+ .internal()
+ .doc("Whether to enable Jetty's SNI host check on the ThriftHttpCLIService HTTPS " +
+ "connector. Spark has disabled SNI host check to preserve backward compatibility. " +
+ "Set to true to enforce SNI host checking for " +
+ "stricter security.")
+ .version("4.3.0")
+ .booleanConf
+ .createWithDefault(false)
Review Comment:
Sorry about that, I used the apply suggestion button this time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #55308:
URL: https://github.com/apache/spark/pull/55308#discussion_r3190197218
##########
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:
##########
@@ -91,8 +93,14 @@ protected void initializeServer() {
Arrays.toString(sslContextFactoryServer.getExcludeProtocols()));
sslContextFactoryServer.setKeyStorePath(keyStorePath);
sslContextFactoryServer.setKeyStorePassword(keyStorePassword);
+ // SPARK-54293: Disable SNI host check, which defaults to true since Jetty 10.
Review Comment:
also cc @pan3793
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Make ThriftHttpCLIService SNI host check configurable [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4508728983
thanks, merged to master/4.x
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4480155848
Done -- removed JIRA references from the doc string and updated version to 4.3.0. Thanks @pan3793!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4480579906
PR title needs to be updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4423434919
Updated `.version("4.2.0")` to `.version("5.0.0")` — happy for this to land in the next release rather than 4.2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4382043236
can we follow SPARK-56528 (https://github.com/apache/spark/pull/55396) to make it configurable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #55308:
URL: https://github.com/apache/spark/pull/55308#discussion_r3260680533
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/StaticSQLConf.scala:
##########
@@ -122,6 +122,17 @@ object StaticSQLConf {
.booleanConf
.createWithDefault(false)
+ val HIVE_THRIFT_SERVER_HTTP_SNI_HOST_CHECK_ENABLED =
+ buildStaticConf("spark.sql.hive.thriftServer.http.sniHostCheckEnabled")
+ .internal()
+ .doc("Whether to enable Jetty's SNI host check on the ThriftHttpCLIService HTTPS " +
+ "connector. Since SPARK-45522 (Jetty 10+), Spark has disabled SNI host check to " +
+ "preserve backward compatibility. Set to true to enforce SNI host checking for " +
+ "stricter security. See SPARK-54293.")
+ .version("5.0.0")
Review Comment:
as default value does not change the current behavior, we can deliver this in 4.3.0. and it's not necessary to mention which JIRA ticket added the config in doc.
```suggestion
"stricter security.")
.version("4.3.0")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Make ThriftHttpCLIService SNI host check configurable [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #55308: [SPARK-54293][SQL] Make ThriftHttpCLIService SNI host check configurable
URL: https://github.com/apache/spark/pull/55308
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4479865265
@pan3793 Gentle ping -- is this ready to merge? Let me know if there is anything else needed. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #55308:
URL: https://github.com/apache/spark/pull/55308#discussion_r3261074030
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/StaticSQLConf.scala:
##########
@@ -122,6 +122,17 @@ object StaticSQLConf {
.booleanConf
.createWithDefault(false)
+ val HIVE_THRIFT_SERVER_HTTP_SNI_HOST_CHECK_ENABLED =
+ buildStaticConf("spark.sql.hive.thriftServer.http.sniHostCheckEnabled")
+ .internal()
+ .doc("Whether to enable Jetty's SNI host check on the ThriftHttpCLIService HTTPS " +
+ "connector. Spark has disabled SNI host check to preserve backward compatibility. " +
+ "Set to true to enforce SNI host checking for " +
+ "stricter security.")
+ .version("4.3.0")
+ .booleanConf
+ .createWithDefault(false)
Review Comment:
Seems you AI agent just ignores the code suggestion, I mean only remove the `See SPARK-54293.`
I re-loop the PR description, it seems it actually breaks again:
1. prior to SPARK-45522 (sni host check is disabled)
2. SPARK-45522 (sni host check is enabled, silent breaking change without mention in the migration guide, nor config)
3. this PR should keep the SPARK-45522 behavior by default to avoid another breaking change, so set the default value to true
```suggestion
.doc("Whether to enable Jetty's SNI host check on the ThriftHttpCLIService HTTPS " +
"connector. Set to false to restore the behavior prior to SPARK-45522 (Jetty 10+).")
.version("4.3.0")
.booleanConf
.createWithDefault(true)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Make ThriftHttpCLIService SNI host check configurable [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #55308:
URL: https://github.com/apache/spark/pull/55308#issuecomment-4482208791
@pan3793 Sorry for not applying the recommended change as is earlier, I used the apply suggestion button this time to do so.
Also changed the code comments to reflect the default behavior, updated PR title as well. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54293][SQL] Disable SNI host check in ThriftHttpCLIService [spark]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #55308:
URL: https://github.com/apache/spark/pull/55308#discussion_r3217110108
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/StaticSQLConf.scala:
##########
@@ -122,6 +122,17 @@ object StaticSQLConf {
.booleanConf
.createWithDefault(false)
+ val HIVE_THRIFT_SERVER_HTTP_SNI_HOST_CHECK_ENABLED =
+ buildStaticConf("spark.sql.hive.thriftServer.http.sniHostCheckEnabled")
+ .internal()
+ .doc("Whether to enable Jetty's SNI host check on the ThriftHttpCLIService HTTPS " +
+ "connector. Since SPARK-45522 (Jetty 10+), Spark has disabled SNI host check to " +
+ "preserve backward compatibility. Set to true to enforce SNI host checking for " +
+ "stricter security. See SPARK-54293.")
+ .version("4.2.0")
Review Comment:
code change lgtm, this requires a PMC member to justify whether to include this in 4.2 as a late-arriving feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org