Skip to content

Enable hostname verification by default with SSLSocketFactory - #2185

Merged
acogoluegnes merged 1 commit into
mainfrom
socket-factory-hostname-verification
Nov 16, 2026
Merged

acogoluegnes merged 1 commit into
mainfrom
socket-factory-hostname-verification

Conversation

@acogoluegnes

Copy link
Copy Markdown
Contributor

ConnectionFactory#setSocketFactory now enables server hostname verification when it receives an SSLSocketFactory, like useSslProtocol and setSslContextFactory already do for blocking IO.

Hostname verification is now a flag applied when the frame handler factory is created, instead of being added to the socket configurator each time it is enabled. Enabling it several times no longer stacks configurators, and setSocketConfigurator no longer removes it. useTlsWithNoVerification still disables it.

ConnectionFactory#setSocketFactory now enables server hostname
verification when it receives an SSLSocketFactory, like
useSslProtocol and setSslContextFactory already do for blocking IO.

Hostname verification is now a flag applied when the frame handler
factory is created, instead of being added to the socket configurator
each time it is enabled. Enabling it several times no longer stacks
configurators, and setSocketConfigurator no longer removes it.
useTlsWithNoVerification still disables it.
@acogoluegnes acogoluegnes added this to the 6.0.0 milestone Nov 16, 2026
@acogoluegnes
acogoluegnes marked this pull request as ready for review November 16, 2026 14:29
@acogoluegnes
acogoluegnes merged commit 0b3ab0f into main Nov 16, 2026
7 checks passed
@acogoluegnes
acogoluegnes deleted the socket-factory-hostname-verification branch November 16, 2026 14:29
@acogoluegnes

Copy link
Copy Markdown
Contributor Author

People needing to disable hostname verification (not recommended, because not safe) can use the ConnectionFactory#disableHostnameVerification() opt-out added in 6.0, see #2187.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant