httpcore2 2.13.0__tar.gz → 2.13.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {httpcore2-2.13.0 → httpcore2-2.13.1}/CHANGELOG.md +9 -0
  2. {httpcore2-2.13.0 → httpcore2-2.13.1}/PKG-INFO +10 -1
  3. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/connection.py +1 -1
  4. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/http_proxy.py +5 -4
  5. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/socks_proxy.py +3 -1
  6. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/connection.py +1 -1
  7. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/http_proxy.py +5 -4
  8. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/socks_proxy.py +3 -1
  9. {httpcore2-2.13.0 → httpcore2-2.13.1}/.gitignore +0 -0
  10. {httpcore2-2.13.0 → httpcore2-2.13.1}/LICENSE.md +0 -0
  11. {httpcore2-2.13.0 → httpcore2-2.13.1}/README.md +0 -0
  12. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/__init__.py +0 -0
  13. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_api.py +0 -0
  14. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/__init__.py +0 -0
  15. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/connection_pool.py +0 -0
  16. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/http11.py +0 -0
  17. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/http2.py +0 -0
  18. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_async/interfaces.py +0 -0
  19. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/__init__.py +0 -0
  20. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/anyio.py +0 -0
  21. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/auto.py +0 -0
  22. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/base.py +0 -0
  23. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/mock.py +0 -0
  24. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/sync.py +0 -0
  25. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_backends/trio.py +0 -0
  26. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_exceptions.py +0 -0
  27. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_models.py +0 -0
  28. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_ssl.py +0 -0
  29. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/__init__.py +0 -0
  30. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/connection_pool.py +0 -0
  31. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/http11.py +0 -0
  32. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/http2.py +0 -0
  33. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_sync/interfaces.py +0 -0
  34. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_synchronization.py +0 -0
  35. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_trace.py +0 -0
  36. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/_utils.py +0 -0
  37. {httpcore2-2.13.0 → httpcore2-2.13.1}/httpcore2/py.typed +0 -0
  38. {httpcore2-2.13.0 → httpcore2-2.13.1}/pyproject.toml +0 -0
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
+ ## 2.13.1 (September 23rd, 2026)
8
+
9
+ ### Fixed
10
+
11
+ * Honor the `sni_hostname` extension for TLS inside HTTP proxy tunnels without applying it to the proxy's TLS connection.
12
+ ([#1223](https://github.com/pydantic/httpx2/pull/1223))
13
+ * Prefer HTTP/2 during TLS protocol negotiation when enabled, and stop advertising HTTP/1.1 when it is disabled.
14
+ ([#1155](https://github.com/pydantic/httpx2/pull/1155))
15
+
7
16
  ## 2.13.0 (September 14th, 2026)
8
17
 
9
18
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: httpcore2
3
- Version: 2.13.0
3
+ Version: 2.13.1
4
4
  Summary: A minimal low-level HTTP client.
5
5
  Project-URL: Changelog, https://github.com/pydantic/httpx2/blob/main/src/httpcore2/CHANGELOG.md
6
6
  Project-URL: Homepage, https://github.com/pydantic/httpx2
@@ -152,6 +152,15 @@ All notable changes to this project will be documented in this file.
152
152
 
153
153
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
154
154
 
155
+ ## 2.13.1 (September 23rd, 2026)
156
+
157
+ ### Fixed
158
+
159
+ * Honor the `sni_hostname` extension for TLS inside HTTP proxy tunnels without applying it to the proxy's TLS connection.
160
+ ([#1223](https://github.com/pydantic/httpx2/pull/1223))
161
+ * Prefer HTTP/2 during TLS protocol negotiation when enabled, and stop advertising HTTP/1.1 when it is disabled.
162
+ ([#1155](https://github.com/pydantic/httpx2/pull/1155))
163
+
155
164
  ## 2.13.0 (September 14th, 2026)
156
165
 
157
166
  ### Changed
@@ -128,7 +128,7 @@ class AsyncHTTPConnection(AsyncConnectionInterface):
128
128
 
129
129
  if self._origin.scheme in (b"https", b"wss"):
130
130
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
131
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
131
+ alpn_protocols = (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
132
132
  ssl_context.set_alpn_protocols(alpn_protocols)
133
133
 
134
134
  kwargs = {
@@ -191,7 +191,7 @@ class AsyncForwardHTTPConnection(AsyncConnectionInterface):
191
191
  url=url,
192
192
  headers=headers,
193
193
  content=request.stream,
194
- extensions=request.extensions,
194
+ extensions={key: value for key, value in request.extensions.items() if key != "sni_hostname"},
195
195
  )
196
196
  return await self._connection.handle_async_request(proxy_request)
197
197
 
@@ -274,7 +274,7 @@ class AsyncTunnelHTTPConnection(AsyncConnectionInterface):
274
274
  method=b"CONNECT",
275
275
  url=connect_url,
276
276
  headers=connect_headers,
277
- extensions=request.extensions,
277
+ extensions={key: value for key, value in request.extensions.items() if key != "sni_hostname"},
278
278
  )
279
279
  connect_response = await self._connection.handle_async_request(connect_request)
280
280
 
@@ -289,12 +289,13 @@ class AsyncTunnelHTTPConnection(AsyncConnectionInterface):
289
289
 
290
290
  # Upgrade the stream to SSL
291
291
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
292
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
292
+ alpn_protocols = (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
293
293
  ssl_context.set_alpn_protocols(alpn_protocols)
294
294
 
295
+ server_hostname = request.extensions.get("sni_hostname") or self._remote_origin.host.decode("ascii")
295
296
  kwargs = {
296
297
  "ssl_context": ssl_context,
297
- "server_hostname": self._remote_origin.host.decode("ascii"),
298
+ "server_hostname": server_hostname,
298
299
  "timeout": timeout,
299
300
  }
300
301
  async with Trace("start_tls", logger, request, kwargs) as trace:
@@ -242,7 +242,9 @@ class AsyncSocks5Connection(AsyncConnectionInterface):
242
242
  # Upgrade the stream to SSL
243
243
  if self._remote_origin.scheme in (b"https", b"wss"):
244
244
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
245
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
245
+ alpn_protocols = (
246
+ (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
247
+ )
246
248
  ssl_context.set_alpn_protocols(alpn_protocols)
247
249
 
248
250
  kwargs = {
@@ -128,7 +128,7 @@ class HTTPConnection(ConnectionInterface):
128
128
 
129
129
  if self._origin.scheme in (b"https", b"wss"):
130
130
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
131
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
131
+ alpn_protocols = (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
132
132
  ssl_context.set_alpn_protocols(alpn_protocols)
133
133
 
134
134
  kwargs = {
@@ -191,7 +191,7 @@ class ForwardHTTPConnection(ConnectionInterface):
191
191
  url=url,
192
192
  headers=headers,
193
193
  content=request.stream,
194
- extensions=request.extensions,
194
+ extensions={key: value for key, value in request.extensions.items() if key != "sni_hostname"},
195
195
  )
196
196
  return self._connection.handle_request(proxy_request)
197
197
 
@@ -274,7 +274,7 @@ class TunnelHTTPConnection(ConnectionInterface):
274
274
  method=b"CONNECT",
275
275
  url=connect_url,
276
276
  headers=connect_headers,
277
- extensions=request.extensions,
277
+ extensions={key: value for key, value in request.extensions.items() if key != "sni_hostname"},
278
278
  )
279
279
  connect_response = self._connection.handle_request(connect_request)
280
280
 
@@ -289,12 +289,13 @@ class TunnelHTTPConnection(ConnectionInterface):
289
289
 
290
290
  # Upgrade the stream to SSL
291
291
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
292
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
292
+ alpn_protocols = (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
293
293
  ssl_context.set_alpn_protocols(alpn_protocols)
294
294
 
295
+ server_hostname = request.extensions.get("sni_hostname") or self._remote_origin.host.decode("ascii")
295
296
  kwargs = {
296
297
  "ssl_context": ssl_context,
297
- "server_hostname": self._remote_origin.host.decode("ascii"),
298
+ "server_hostname": server_hostname,
298
299
  "timeout": timeout,
299
300
  }
300
301
  with Trace("start_tls", logger, request, kwargs) as trace:
@@ -242,7 +242,9 @@ class Socks5Connection(ConnectionInterface):
242
242
  # Upgrade the stream to SSL
243
243
  if self._remote_origin.scheme in (b"https", b"wss"):
244
244
  ssl_context = default_ssl_context() if self._ssl_context is None else self._ssl_context
245
- alpn_protocols = ["http/1.1", "h2"] if self._http2 else ["http/1.1"]
245
+ alpn_protocols = (
246
+ (["h2", "http/1.1"] if self._http1 else ["h2"]) if self._http2 else ["http/1.1"]
247
+ )
246
248
  ssl_context.set_alpn_protocols(alpn_protocols)
247
249
 
248
250
  kwargs = {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes