Skip to content

Do not skip hostname verification when the CLIENT policy has no verifier - #916

Merged
arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:client-policy-verifier
Nov 1, 2026
Merged

arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:client-policy-verifier

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Since the default verifier fallback was removed (#649), HostnameVerificationPolicy.CLIENT or BOTH with a null HostnameVerifier performs no hostname verification. ConscryptClientTlsStrategy(ctx) and the deprecated DefaultClientTlsStrategy constructor end up in that state.

This keeps the separation between verification policy and verifier configuration:

  • ConscryptClientTlsStrategy and the deprecated DefaultClientTlsStrategy constructor select BUILTIN when no verifier is given
  • AbstractClientTlsStrategy rejects CLIENT / BOTH without a verifier

Alternative to #914. Tests added.

@arturobernalg
arturobernalg requested a review from ok2c November 1, 2026 09:16
Since the default verifier fallback was removed, CLIENT or BOTH policy
with a null HostnameVerifier performed no hostname verification at all.
ConscryptClientTlsStrategy and the deprecated DefaultClientTlsStrategy
constructor now select the BUILTIN policy when no verifier is given, and
AbstractClientTlsStrategy rejects CLIENT or BOTH without a verifier.
@arturobernalg
arturobernalg force-pushed the client-policy-verifier branch from 1b90f73 to 2a60d23 Compare November 1, 2026 10:00
@arturobernalg
arturobernalg merged commit 9e45136 into apache:master Nov 1, 2026
10 checks passed
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