fix(tls): skip server_name override when dialing an HTTPS proxy#25899
fix(tls): skip server_name override when dialing an HTTPS proxy#25899gwenaskell wants to merge 9 commits into
Conversation
The inner connector's callback runs for both direct destination connections and the TLS connection to an HTTPS forward proxy. Pinning the verify parameter to the destination `server_name` on the proxy connection would verify the proxy's own certificate against the upstream name and fail with a hostname mismatch. Exclude the configured proxy hosts from the `server_name` override so proxy certificates are verified against the proxy host.
Both fixes ship in the same release, so combine them into a single changelog entry.
There are only ever two proxy hosts (http and https), so a small struct with a matches() helper is clearer than a Vec.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e15eba97d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…r_name skip The previous host-only check could skip the server_name override for a direct destination connection that merely shared a host with a configured proxy (e.g. a no_proxy bypass on a different port, or an https destination sharing a host with an http-scheme proxy). Only track proxies reached over TLS (https:// URLs) and match the full authority (host and port) so the skip applies solely to the actual proxy connection.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e818acba96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
vladimir-dd
left a comment
There was a problem hiding this comment.
Left some minor suggestions, otherwise makes sense to me.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 939d1cdb2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
pront
left a comment
There was a problem hiding this comment.
This change makes sense to me. I left one quesiton.
Summary
Follow-up to the merged
tls.server_nameOpenSSL verification fix (#25881).The proxy connector uses one inner
HttpsConnectorto dial both the destination directly (no_proxy) and, for proxied requests, the proxy itself (hyper-proxycallsself.connector.call(proxy_url)). Its per-connection callback pins the X509 verify parameter to the destinationtls.server_name. For an HTTPS proxy that means the proxy's own certificate gets verified against the upstreamserver_name, failing with a hostname mismatch.apply_connect_configurationgains askip_server_nameflag; when set it behaves as if noserver_namewere configured (verification falls back to the connection URL host).server_nameoverride when dialing a proxy.build_proxy_connectorcollects the proxy hosts (whenenabled) and passes them to the connector;build_tls_connectorpasses an empty list so direct callers are unaffected.Result:
no_proxydestination ->server_nameapplied (verified againstserver_name).server_nameskipped (proxy cert verified against the proxy host).server_namestill can't be applied there (hyper-proxylimitation), which the existingwarn!covers.Test plan
cargo test -p vector-core --lib tls::settings::test— the end-to-end handshake test now also asserts that with the override skipped, connecting by IP withserver_nameset fails (i.e. verifies against the URL host, as a proxy connection would).cargo check --libfor thevectorcrate.Change Type
Is this a breaking change?
Does this PR include user facing changes?