From 5a89e8d70f02ce9919fb1780030886a10bc0a6dc Mon Sep 17 00:00:00 2001 From: Sam Collinson Date: Fri, 5 Dec 2025 12:12:07 +1300 Subject: [PATCH] create_ssl_context: Don't skip ctx.load_cert_chain call when verify is a str --- httpx/_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/httpx/_config.py b/httpx/_config.py index 467a6c90ae..0cb239b93f 100644 --- a/httpx/_config.py +++ b/httpx/_config.py @@ -50,8 +50,9 @@ def create_ssl_context( ) warnings.warn(message, DeprecationWarning) if os.path.isdir(verify): - return ssl.create_default_context(capath=verify) - return ssl.create_default_context(cafile=verify) + ctx = ssl.create_default_context(capath=verify) + else: + ctx = ssl.create_default_context(cafile=verify) else: ctx = verify