Repository navigation
Server name SSL bundles with upper-case server names are not used with Netty - #52289
Merged
Merged
Conversation
challa
added a commit
to challa/spring-boot
that referenced
this pull request
Oct 19, 2026
SslServerCustomizer looked up the SSL provider for an SNI host name with an exact, case-sensitive match. Netty lowercases the SNI host name, so a configured server name containing an upper-case letter was never matched and the default bundle was used instead. A wildcard server name such as "*.example.com" was never matched either. This commit makes the lookup case-insensitive and falls back to a wildcard for the first label, as Tomcat does. See spring-projectsgh-52289 Signed-off-by: Challa Srinivasa Reddy <challa.srinivasareddy@gmail.com>
challa
force-pushed
the
gh-netty-sni-host-names
branch
from
October 19, 2026 03:23
d20ea41 to
ae0a4db
Compare
SslServerCustomizer looked up the SSL provider for an SNI host name with an exact, case-sensitive match. Netty lowercases the SNI host name, so a configured server name containing an upper-case letter was never matched and the default bundle was used instead. See spring-projectsgh-52289 Signed-off-by: Challa Srinivasa Reddy <challa.srinivasareddy@gmail.com>
snicoll
force-pushed
the
gh-netty-sni-host-names
branch
from
October 22, 2026 14:30
ae0a4db to
7f200bc
Compare
snicoll
added a commit
to challa/spring-boot
that referenced
this pull request
Oct 22, 2026
Restrict the change to matching server names case-insensitively, and apply it to RSocket as well, which has its own copy of the lookup. Server names are normalized when they are registered or updated, and when they are looked up. See spring-projectsgh-52289
snicoll
added a commit
to challa/spring-boot
that referenced
this pull request
Oct 22, 2026
Remove the wildcard matching, and apply the case-insensitive lookup to RSocket as well, which has its own copy of it. The server name providers are held in a case-insensitive map so that the lookup, the registration and the update of a server name all match case-insensitively. See spring-projectsgh-52289 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
snicoll
force-pushed
the
gh-netty-sni-host-names
branch
from
October 22, 2026 14:59
7f200bc to
efafca7
Compare
Remove the wildcard matching, and apply the case-insensitive lookup to RSocket as well, which has its own copy of it. The server name providers are held in a case-insensitive map so that the lookup, the registration and the update of a server name all match case-insensitively. See spring-projectsgh-52289
snicoll
force-pushed
the
gh-netty-sni-host-names
branch
from
October 22, 2026 14:59
efafca7 to
45229d4
Compare
Member
|
Thanks for the PR, I stripped the enhancement for wildcards and polished the proposal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the Netty web server, an entry in
server.ssl.server-name-bundleswhoseserver-namecontains an upper-case letter is never used. Netty lowercases the SNI host name sent by the client, and the lookup inSslServerCustomizercompares it case-sensitively with the configured name, soserver-name: "Api.Example.com"never matches. The handshake then uses the default bundle instead of the configured bundle. If the default certificate does not cover the requested host name, clients performing host name verification reject the connection. Host names are case-insensitive, and Tomcat matches them regardless of case.A wildcard
server-namesuch as*.example.comis not matched with Netty either. Tomcat supports wildcards, and so do Reactor Netty's own SNI mappings, but Spring Boot's lookup only does exact matches.To reproduce, configure a default bundle plus
server-name: "Api.Example.com"(or"*.example.com") with another bundle, and connect with SNIapi.example.com. Tomcat presents the mapped certificate and Netty presents the default one.This change makes the lookup case-insensitive and falls back to
*followed by everything from the first dot, which is the rule Tomcat uses.*.example.comtherefore matchesapi.example.combut notexample.comora.b.example.com. The two new tests fail without the change. If you'd rather treat wildcard matching as an enhancement, I can split it out.I used an AI coding assistant for parts of the analysis; I reviewed and verified the change and tests myself.