From b1c39523ae3b5d6a3b8c3e49b0feca21242db2c9 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 3 Dec 2024 14:07:21 +0000 Subject: [PATCH 1/2] Fix `verify=False`, `cert=...` case. --- httpx/_config.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/httpx/_config.py b/httpx/_config.py index dbd2b46cd1..467a6c90ae 100644 --- a/httpx/_config.py +++ b/httpx/_config.py @@ -39,10 +39,9 @@ def create_ssl_context( # Default case... ctx = ssl.create_default_context(cafile=certifi.where()) elif verify is False: - ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - return ssl_context + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE elif isinstance(verify, str): # pragma: nocover message = ( "`verify=` is deprecated. " From 9efc4f3a9b5af91e903942224fe21d99a9e87251 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 4 Dec 2024 09:16:35 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc3fa411f8..4c746d6bba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Dev + +* Fix SSL case where `verify=False` together with client side certificates. + ## 0.28.0 (28th November, 2024) The 0.28 release includes a limited set of deprecations.