OpenAI Python SDK Switches to HTTPX2, Breaking TLS Defaults
OpenAI: Migrating to HTTPX2
The OpenAI Python SDK now uses HTTPX2 for its HTTP clients, replacing the legacy httpx package. This change alters the default TLS trust store from certifi to the operating system's, which can break certificate verification in minimal containers or corporate proxy environments. The SDK no longer installs httpx or certifi, so applications that relied on transitive dependencies must adapt. The migration guide covers custom clients, timeouts, auth hooks, streaming, mocking, and a temporary escape hatch for legacy HTTPX integrations.
HTTPX2 changes the default TLS trust store, including for applications that use the SDK's default HTTP client.
- simonw
Anthropic made the same change a few weeks after OpenAI did: https://github.com/anthropics/anthropic-sdk-python/releases/...
The problem with httpx as a dependency is that it's currently working towards a 1.0 release which will be full of breaking changes.
The httpx2 project is essentially a fork that promises not to break the existing API, which makes it a more stable dependency to build against.
I wrote a pretty long comment about my concerns for the breaking 1.0 version last year - https://github.com/encode/httpx/discussions/3344#discussionc... - in that comment I recommended the HTTPX project release their 1.0 as a package called httpx2 instead, but a year later we now have an httpx2 (released by a different maintainer) that keeps the old API.
- jklehm
Wonder if they evaluated httpx2 vs niquests: https://github.com/jawah/niquests
- i574n
A network error occurred. Please check your connection and try again. If this issue persists please contact us through our help center at help.openai.com.
yeah nice engineering clowns
- shay_ker
i assume this is largely about the cybersecurity blitz, to ensure hot-path code is secure?
- ZeroCool2u
The requests packages fundamental API is good enough and is now maintained by the PSF. I don't understand why OpenAI and Anthropic don't just throw some $$$ to the PSF for focused improvements and expansion of it.