pypi / urllib3
urllib3
What changed in urllib3 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
47 breaking11 security15 deprecations24 new APIs and options2 performance8 behavior and defaults2 tooling31 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initurllib3 2140 changes
Breaking changes 47
A supported-length fingerprint containing non-hexadecimal characters now raises SSLError instead of binascii.Error.
Forwarding through an HTTPS proxy no longer applies target SNI, assertions, or client credentials to proxy handshakes; the proxy SSL context and identity checks are respected.
PoolManager no longer passes assert_hostname and assert_fingerprint parameters to HTTP connection pools.
Retries of request bodies with tell() but no seek() now raise UnrewindableBodyError instead of ValueError.
HTTP(S) host parsing now strictly enforces RFC 3986 syntax, rejects invalid host input, and normalizes percent-encoded octets according to RFC 3986.
The minimum supported pyOpenSSL version is now 19.0.0.
Support for end-of-life PyPy3.10 has been removed.
Support for end-of-life Python 3.9 has been removed.
Retry-After times greater than 6 hours are treated as 6 hours by default.
Custom decompressors must be updated to respect the changed API.
Removed in favor of HTTPResponse.headers.get(name, default).
Removed in favor of HTTPResponse.headers.
Certificate hostnames are now verified using subjectAltName only; commonName is no longer used.
Implementations other than CPython or PyPy3 are no longer supported.
The default is now True, preventing silent data loss when reading streamed responses.
All constructor parameters are now keyword-only except host and port.
Returns an urllib3.HTTPResponse instance instead of an http.client.HTTPResponse.
Updating the timeout before the next request now uses the new timeout rather than reusing the previous response's socket read timeout.
Reads now follow io.BufferedIOBase semantics regardless of compression: only EOF returns empty bytes, reads never exceed the requested size, and calls may issue any number of system calls.
Connecting via HTTPS when the ssl module is unavailable now raises ImportError instead of SSLError.
Header parameter formatting now matches the WHATWG HTML Standard as of 2021-06-10; control characters in filenames are no longer percent encoded.
TLS libraries such as LibreSSL and wolfSSL are no longer supported.
OpenSSL versions earlier than 1.1.1 or without SNI support are no longer supported; an ImportError is raised when an incompatible version is detected.
OpenSSL versions older than 1.1.1 are no longer supported.
Support for Python 2.7, 3.5, and 3.6 was removed.
Python 3.10 or later is required; Python 2.7 and Python 3.5–3.9 are no longer supported.
The default request body encoding changed from ISO-8859-1 to UTF-8.
The deprecated DEFAULT_REDIRECT_HEADERS_BLACKLIST option was removed.
The deprecated method_whitelist option was removed.
Renamed from Retry.BACK0FF_MAX.
Sets SSLContext.maximum_version.
Set ssl_minimum_version to a proper value to continue using legacy TLS versions.
It now sets the corresponding SSLContext.minimum_version and maximum_version values; SSLContext objects are constructed using ssl.PROTOCOL_TLS_CLIENT regardless of ssl_version.
The default minimum TLS version is now TLSVersion.TLSv1_2.
Remove the strict parameter because it is unneeded with Python 3.
urllib3 no longer supplies a default cipher set and instead uses the ciphers configured by the system.
The default minimum TLS version is now TLS 1.2 instead of TLS 1.0.
The secure extra was removed.
Importing VerifiedHTTPSConnection from connectionpool is no longer possible; the class is documented in connection, and its new name is HTTPSConnection.
AppEngineManager and support for Google App Engine Standard Environment were removed.
The urllib3.contrib.ntlmpool module was removed.
Support for SSLv3.0 was removed from this module, even when the compiled OpenSSL library supports it.
The urllib3.contrib.securetransport module was removed.
SNIMissingWarning was removed.
The from_httplib method was removed.
The urllib3.request module was removed; RequestMethods is now a private API so importing request from urllib3 resolves to the top-level request() function.
No longer overrides system cipher suites with a default value; the operating system's configured cipher suites are used.
Security 11
is_ipaddress() now detects non-standard IPv4 forms accepted by socket.connect, ensuring SSL certificate verification uses the correct mode for those addresses.
HTTPS proxy TLS settings are no longer ignored or overridden by destination TLS settings. Configure proxy CA certificates and client certificates in proxy_ssl_context.
Safeguards prevent potential security issues when proxy tunneling handles invalid characters in the proxy host and HTTP headers.
urllib3: Chunked Deflate streaming can enter an infinite loop
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
Fixed streaming API cases that bypassed decompression-bomb safeguards after partial reads or when using the official Brotli library.
ProxyManager pools now strip sensitive headers specified in this setting when redirecting to a different host.
Fixed a security issue that bypassed streaming API decompression-bomb safeguards when following HTTP redirects.
Chained encodings are limited to 5 to prevent denial-of-service attacks that exhaust resources during decoding.
Reading small chunks of highly compressed content is safer and more efficient, preventing excessive resource consumption when only a small amount of data is requested.
TLS handshakes now use SSLContext.check_hostname when possible.
Deprecations 15
Using an empty collection for Retry.allowed_methods to retry any verb is deprecated.
Removal of deprecated features has been rescheduled to version 3.0.
Existing deprecation notices now use FutureWarning instead of DeprecationWarning for better visibility.
Use format_multipart_header_param instead.
Pass chunked=True to HTTPConnection.request() instead; request_chunked() will be removed in urllib3 v2.1.0.
Use HTTPResponse.headers.get(name, default) instead; getheader() will be removed in urllib3 v2.1.0.
Use HTTPResponse.headers instead; getheaders() will be removed in urllib3 v2.1.0.
Pass parameters to the HTTPSConnection constructor instead.
The header_formatter parameter is deprecated and will be removed in urllib3 v2.1.0.
The ssl_version option is deprecated and will be removed in urllib3 v3.0; use ssl_minimum_version instead.
Use ssl_minimum_version instead; ssl_version will be removed in urllib3 v2.1.0.
The strict parameter is deprecated because it is no longer needed in Python 3.x and will be removed in urllib3 v2.1.0.
The pyopenssl module is deprecated and will be removed in urllib3 v2.1.0.
The securetransport module is deprecated and will be removed in urllib3 v2.1.0.
URLs without a scheme are deprecated and will raise an error in a future urllib3 version.
New APIs and options 24
urllib3.util.make_headers() now accepts a basic_auth_encoding parameter.
urllib3.util.make_headers() now accepts a proxy_basic_auth_encoding parameter.
The result of parse_url() now has an auth_decoded convenience property.
The result of parse_url() now has an auth_decoded_joined convenience property.
A public API interface is available for subclassing connections using supported APIs.
A public API interface is available for subclassing responses using supported APIs.
Raised when PoolManager(block=True) and a connection is returned to a full pool.
Added the has_connected_to_proxy property.
Added the is_closed property.
Added the is_connected property.
The scheme parameter configures the scheme of the origin being tunnelled to.
When combine=True, a new header value is merged with an existing value into a comma-separated list; otherwise duplicate values are repeated.
HTTPHeaderDict is available in the top-level urllib3 namespace.
Responses can be deserialized from JSON into Python objects with HTTPResponse.json().
A new exception is raised when a DNS error occurs.
Added the proxy_assert_fingerprint keyword argument.
Added the proxy_assert_hostname keyword argument.
The new json= parameter sends a JSON request body and adds Content-Type: application/json by default.
Added an optional backoff_jitter parameter.
A configurable backoff_max parameter replaces Retry.DEFAULT_BACKOFF_MAX when provided.
Set this to True to enable verifying the hostname against commonName.
The authority property follows RFC 3986 section 3.2 and can replace netloc when including the URI userinfo component.
A top-level request function sends requests using a global pool manager, avoiding the need to configure a PoolManager for simple use cases.
Zstandard support is available when zstandard 1.18.0 or later is installed; the zstd extra installs the package.
Performance 2
Streamed response decoding is faster.
Content decoding is faster due to an optimization to BytesQueueBuffer.
Behavior and default changes 8
The default pool queue class is resolved from the queue module after ConnectionPool instantiation, allowing late monkey-patching such as by gevent.
String representations now include host and port information.
Bytes keys can now be used to retrieve, delete, and test membership in HTTPHeaderDict.
Support for Python 3.14 free-threading builds is now explicit.
The default blocksize is now 16KB to match OpenSSL's default read amounts.
Certificate verification now relies on Python’s certificate verification instead of urllib3’s handling, which should speed verification and expose Python or OpenSSL improvements.
Fixed its default value to match HTTPConnection.socket_options.
Now wraps any connection error, including timeout, TLS, and DNS errors, that occurs when connecting to the proxy.
Tooling 2
A test dependency group containing the minimum dependencies needed to run the test suite is available for downstream packagers.
APIs are type-hinted, enabling type-checking and better IDE autocomplete suggestions.
Fixes and other changes 31
Handling of HTTP 303 redirects is fixed for requests with chunked or file-like bodies.
URL fragments are stripped from absolute request targets before HTTPConnectionPool.urlopen() and HTTP proxy forwarding send requests.
An invalid timeout argument on a pool created with block=True now raises ValueError instead of a misleading FullPoolError.
Unread response data is discarded in 64 KiB chunks, matching the default amt used by HTTPResponse.stream(...).
Obsolete folded response header lines are replaced with spaces in accordance with RFC 9112, preventing raw CRLF sequences from appearing in header values such as Set-Cookie.
Explicit :0 values are preserved instead of being replaced with default ports 80 or 443 across URL parsing, pool selection, proxy configuration, connection_from_url(), and HTTP/2 request authority.
proxy_ssl_context now works with ProxyManager when use_forwarding_for_https=True. Passing ssl_context instead emits a FutureWarning and will raise an error in v3.0.
Percent-encoded SOCKS proxy credentials are decoded before authentication with the proxy server.
An AttributeError on Python built with OpenSSL 4+ is fixed when ssl.PROTOCOL_TLSv1 no longer exists.
Certificate subject reading and encrypted private-key loading use cryptography APIs, avoiding DeprecationWarning from pyOpenSSL 26.3.0+.
The type annotation now accepts memoryview as well as bytearray, matching the io.RawIOBase.readinto contract and enabling use with io.BufferedReader without type errors.
Fixed LocationParseError for paths resembling schemeless URIs passed to urlopen().
Calling read with amt=None now includes decompressed data buffered from previous partial reads.
With cache_content=True, read() now caches the complete response after a partial read.
read_chunked() now handles amt=0.
stream() now handles amt=0.
The type alias now includes Iterable[str], matching documented and runtime behavior for chunked request bodies.
Fixed VerifiedHTTPSConnection on Emscripten.
Fixed read_chunked() to properly handle leftover data in the decoder's buffer when reading compressed chunked responses.
Restores the previously removed HTTPResponse.getheader() method.
Restores the previously removed HTTPResponse.getheaders() method.
Fixed use in Emscripten when no explicit port is provided.
Handling of expandable variables is fixed.
The zstd extra installs backports.zstd instead of zstandard on Python 3.13 and earlier.
Redirect handling is fixed when an integer is passed for the retries parameter.
Fixed a socket leak when connect() fails.
Sets the socket timeout from HTTPConnection.timeout before reading data from the socket.
Chunk boundaries are always lowercase when sending requests with Transfer-Encoding: chunked.
Fixed a thread-safety issue that could close connection pools while requests were in progress when accessing many distinct origins.
OpenSSL.SSL.Error is now wrapped with ssl.SSLError.
Fixed a bug where the feature modified the headers object.