httpcore2 2.15.0__tar.gz → 2.15.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 (39) hide show
  1. {httpcore2-2.15.0 → httpcore2-2.15.1}/CHANGELOG.md +7 -0
  2. {httpcore2-2.15.0 → httpcore2-2.15.1}/PKG-INFO +8 -1
  3. httpcore2-2.15.1/httpcore2/_ssl.py +40 -0
  4. httpcore2-2.15.0/httpcore2/_ssl.py +0 -12
  5. {httpcore2-2.15.0 → httpcore2-2.15.1}/.gitignore +0 -0
  6. {httpcore2-2.15.0 → httpcore2-2.15.1}/LICENSE.md +0 -0
  7. {httpcore2-2.15.0 → httpcore2-2.15.1}/README.md +0 -0
  8. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/__init__.py +0 -0
  9. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_api.py +0 -0
  10. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/__init__.py +0 -0
  11. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/connection.py +0 -0
  12. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/connection_pool.py +0 -0
  13. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/http11.py +0 -0
  14. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/http2.py +0 -0
  15. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/http_proxy.py +0 -0
  16. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/interfaces.py +0 -0
  17. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_async/socks_proxy.py +0 -0
  18. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/__init__.py +0 -0
  19. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/anyio.py +0 -0
  20. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/auto.py +0 -0
  21. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/base.py +0 -0
  22. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/mock.py +0 -0
  23. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/sync.py +0 -0
  24. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_backends/trio.py +0 -0
  25. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_exceptions.py +0 -0
  26. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_models.py +0 -0
  27. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/__init__.py +0 -0
  28. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/connection.py +0 -0
  29. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/connection_pool.py +0 -0
  30. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/http11.py +0 -0
  31. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/http2.py +0 -0
  32. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/http_proxy.py +0 -0
  33. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/interfaces.py +0 -0
  34. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_sync/socks_proxy.py +0 -0
  35. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_synchronization.py +0 -0
  36. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_trace.py +0 -0
  37. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/_utils.py +0 -0
  38. {httpcore2-2.15.0 → httpcore2-2.15.1}/httpcore2/py.typed +0 -0
  39. {httpcore2-2.15.0 → httpcore2-2.15.1}/pyproject.toml +0 -0
@@ -4,6 +4,13 @@ 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.15.1 (October 19th, 2026)
8
+
9
+ ### Fixed
10
+
11
+ * Configure the default SSL context once on Linux, instead of on every handshake. With OpenSSL older than 3.4, CPU usage grew over the lifetime of a reused client.
12
+ ([#1253](https://github.com/pydantic/httpx2/pull/1253))
13
+
7
14
  ## 2.15.0 (October 19th, 2026)
8
15
 
9
16
  ### Removed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: httpcore2
3
- Version: 2.15.0
3
+ Version: 2.15.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
@@ -151,6 +151,13 @@ All notable changes to this project will be documented in this file.
151
151
 
152
152
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
153
153
 
154
+ ## 2.15.1 (October 19th, 2026)
155
+
156
+ ### Fixed
157
+
158
+ * Configure the default SSL context once on Linux, instead of on every handshake. With OpenSSL older than 3.4, CPU usage grew over the lifetime of a reused client.
159
+ ([#1253](https://github.com/pydantic/httpx2/pull/1253))
160
+
154
161
  ## 2.15.0 (October 19th, 2026)
155
162
 
156
163
  ### Removed
@@ -0,0 +1,40 @@
1
+ import os
2
+ import platform
3
+ import re
4
+ import ssl
5
+
6
+ import truststore
7
+
8
+ # Mirrors `truststore`'s Linux fallbacks for when OpenSSL's compiled-in paths are unusable:
9
+ # https://github.com/sethmlarson/truststore/blob/0714f72a739d182cdb8502f4e1bb4cf7ebfe4eb5/src/truststore/_openssl.py#L8-L19
10
+ CA_FILE_CANDIDATES = [
11
+ "/etc/ssl/cert.pem",
12
+ "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
13
+ "/etc/pki/tls/cert.pem",
14
+ "/etc/ssl/certs/ca-certificates.crt",
15
+ "/etc/ssl/ca-bundle.pem",
16
+ ]
17
+
18
+
19
+ # `_trust_env` is internal to `httpx2`; drop it with the Linux branch below once sethmlarson/truststore#213 ships.
20
+ def default_ssl_context(*, _trust_env: bool = True) -> ssl.SSLContext:
21
+ if _trust_env and (cafile := os.environ.get("SSL_CERT_FILE")): # pragma: no cover
22
+ return ssl.create_default_context(cafile=cafile)
23
+ if _trust_env and (capath := os.environ.get("SSL_CERT_DIR")): # pragma: no cover
24
+ return ssl.create_default_context(capath=capath)
25
+ if platform.system() in ("Windows", "Darwin"): # pragma: no cover
26
+ return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
27
+ # `truststore` re-adds verify paths per handshake, which OpenSSL < 3.4 accumulates (sethmlarson/truststore#212).
28
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
29
+ # Compiled-in paths, since `set_default_verify_paths()` would read `SSL_CERT_*`.
30
+ paths = ssl.get_default_verify_paths()
31
+ cafile = paths.openssl_cafile if os.path.isfile(paths.openssl_cafile) else None
32
+ capath = paths.openssl_capath if os.path.isdir(paths.openssl_capath) else None
33
+ if capath and not cafile: # pragma: no cover
34
+ if not any(re.fullmatch(r"[0-9a-fA-F]{8}\.\d", f) for f in os.listdir(capath)):
35
+ capath = None
36
+ if not cafile and not capath: # pragma: no cover
37
+ cafile = next(filter(os.path.isfile, CA_FILE_CANDIDATES), None)
38
+ if cafile or capath:
39
+ ctx.load_verify_locations(cafile, capath)
40
+ return ctx
@@ -1,12 +0,0 @@
1
- import os
2
- import ssl
3
-
4
- import truststore
5
-
6
-
7
- def default_ssl_context() -> ssl.SSLContext:
8
- if cafile := os.environ.get("SSL_CERT_FILE"): # pragma: no cover
9
- return ssl.create_default_context(cafile=cafile)
10
- if capath := os.environ.get("SSL_CERT_DIR"): # pragma: no cover
11
- return ssl.create_default_context(capath=capath)
12
- return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
File without changes
File without changes
File without changes
File without changes
File without changes