Skip to content

Verify HTTPS CONNECT proxies like the target - #988

Merged
benoitc merged 1 commit into
masterfrom
fix/connect-proxy-tls-verify
Oct 25, 2026
Merged

benoitc merged 1 commit into
masterfrom
fix/connect-proxy-tls-verify

Conversation

@benoitc

@benoitc benoitc commented Oct 25, 2026

Copy link
Copy Markdown
Owner

When hackney tunnels through an HTTPS proxy with CONNECT (proxy_transport = ssl), the TLS connection to the proxy carried only the server name. On OTP 27 and later ssl:connect refuses verify_peer without CA certificates, so this setup failed unless proxy_ssl_options supplied cacerts or verify_none; hackney's CA bundle and hostname check were never applied to the proxy. The plain HTTPS proxy path already went through hackney_ssl.

proxy_ssl_opts/2 now builds on hackney_ssl:ssl_opts/2, with proxy_ssl_options merged on top. An explicit {verify, verify_none} is used as given, so existing setups keep working.

Found while triaging a report by manus-pi (GHSA-7893-863r-2xxm); on supported OTP versions nothing unverified was accepted, the connection failed closed.

The proxy leg of a CONNECT tunnel was opened with SNI only. On OTP 27+
that fails to connect without cacerts, and hackney's CA bundle and
hostname check never applied. Build the options with hackney_ssl, as the
target leg does; an explicit verify_none is kept as given.
@benoitc
benoitc force-pushed the fix/connect-proxy-tls-verify branch from 05e92bd to 6823f5c Compare October 25, 2026 20:55
@benoitc
benoitc merged commit 77792c4 into master Oct 25, 2026
6 checks passed
@benoitc benoitc mentioned this pull request Oct 25, 2026
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.

1 participant