Skip to content

Commit

Permalink
HTTPS proxies support (#2845)
Browse files Browse the repository at this point in the history
* Add ssl_context argument to Proxy class

* Changelog
  • Loading branch information
karpetrosyan authored Sep 11, 2023
1 parent adbcd0e commit a54eccc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

* Support HTTPS proxies. (#2845)
* Change the type of `Extensions` from `Mapping[Str, Any]` to `MutableMapping[Str, Any]`. (#2803)
* Add `socket_options` argument to `httpx.HTTPTransport` and `httpx.AsyncHTTPTransport` classes. (#2716)
* The `Response.raise_for_status()` method now returns the response instance. For example: `data = httpx.get('...').raise_for_status().json()`. (#2776)
Expand Down
2 changes: 2 additions & 0 deletions httpx/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def __init__(
self,
url: URLTypes,
*,
ssl_context: typing.Optional[ssl.SSLContext] = None,
auth: typing.Optional[typing.Tuple[str, str]] = None,
headers: typing.Optional[HeaderTypes] = None,
):
Expand All @@ -343,6 +344,7 @@ def __init__(
self.url = url
self.auth = auth
self.headers = headers
self.ssl_context = ssl_context

@property
def raw_auth(self) -> typing.Optional[typing.Tuple[bytes, bytes]]:
Expand Down
1 change: 1 addition & 0 deletions httpx/_transports/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def __init__(
proxy_auth=proxy.raw_auth,
proxy_headers=proxy.headers.raw,
ssl_context=ssl_context,
proxy_ssl_context=proxy.ssl_context,
max_connections=limits.max_connections,
max_keepalive_connections=limits.max_keepalive_connections,
keepalive_expiry=limits.keepalive_expiry,
Expand Down

0 comments on commit a54eccc

Please sign in to comment.