Skip to content

Commit 89599a9

Browse files
authored
Fix verify=False, cert=... case. (#3442)
1 parent 8ecb86f commit 89599a9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## Dev
8+
9+
* Fix SSL case where `verify=False` together with client side certificates.
10+
711
## 0.28.0 (28th November, 2024)
812

913
The 0.28 release includes a limited set of deprecations.

httpx/_config.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ def create_ssl_context(
3939
# Default case...
4040
ctx = ssl.create_default_context(cafile=certifi.where())
4141
elif verify is False:
42-
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
43-
ssl_context.check_hostname = False
44-
ssl_context.verify_mode = ssl.CERT_NONE
45-
return ssl_context
42+
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
43+
ctx.check_hostname = False
44+
ctx.verify_mode = ssl.CERT_NONE
4645
elif isinstance(verify, str): # pragma: nocover
4746
message = (
4847
"`verify=<str>` is deprecated. "

0 commit comments

Comments
 (0)