Skip to content

Conversation

@DHerls
Copy link

@DHerls DHerls commented Feb 14, 2025

Summary

When a user created an HTTPTransport and supplied a URL for their proxy, the SSLContext was not passed to the created proxy. This caused some confusion when I ran into it the first time.

Now, the SSLContext is passed to the proxy when constructing by default.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@deathaxe
Copy link

deathaxe commented Jul 6, 2025

Communication between client and local proxies is usually performed unencrypted

Coupling default SSL context by default would however result in httpx attempting to establish TLS connections to proxies by default.

A caller should better create a Prox() instance explicitly and pass it to Client() on instantiation, in case encrypted client<->proxy communication is required.

Also local proxies may require different, possibly self-signed?, special purpose certificates, which should probably not be leaked to default SSL context under all circumstances.

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