Skip to content

fall back to default hostname verifier in AbstractClientTlsStrategy - #914

Open
Hsnmohd wants to merge 1 commit into
apache:masterfrom
Hsnmohd:tls-client-policy-default-verifier
Open

Hsnmohd wants to merge 1 commit into
apache:masterfrom
Hsnmohd:tls-client-policy-default-verifier

Conversation

@Hsnmohd

@Hsnmohd Hsnmohd commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

AbstractClientTlsStrategy lost its null-verifier fallback in #649, so new ConscryptClientTlsStrategy(sslContext) (which hardcodes CLIENT) and setHostVerificationPolicy(CLIENT) without a verifier skip both endpoint identification and the post-handshake check, and a real exchange with https://some-other-host against a CN=localhost certificate returns 200 through classic, async and a Conscrypt engine, so restore HttpsSupport.getDefaultHostnameVerifier() for CLIENT and BOTH.

@arturobernalg arturobernalg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default hostname verifier fallback was intentionally removed in #649.

Would it be better to fix the Conscrypt constructor to use BUILTIN by default, and reject CLIENT without a verifier, rather than restoring the fallback in AbstractClientTlsStrategy?

I'd prefer to preserve the existing separation between verification policy and verifier configuration.

@ok2c

ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member

@Hsnmohd I agree with @arturobernalg Let's fix it in Conscrypt classes instead.

@ok2c

ok2c commented Oct 31, 2026

Copy link
Copy Markdown
Member

@Hsnmohd This is wrong and must be fixed.

    public ConscryptClientTlsStrategy(
            final SSLContext sslContext,
            final String[] supportedProtocols,
            final String[] supportedCipherSuites,
            final SSLBufferMode sslBufferManagement,
            final HostnameVerifier hostnameVerifier) {
        this(sslContext, supportedProtocols, supportedCipherSuites, sslBufferManagement, HostnameVerificationPolicy.CLIENT, hostnameVerifier); /
    }

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.

3 participants