We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47f4a96 commit ce7e14dCopy full SHA for ce7e14d
httpx/_config.py
@@ -31,6 +31,14 @@ def create_ssl_context(verify: ssl.SSLContext | bool = True) -> ssl.SSLContext:
31
ssl_context.check_hostname = False
32
ssl_context.verify_mode = ssl.CERT_NONE
33
return ssl_context
34
+ elif isinstance(verify, str): # pragma: nocover
35
+ # Explicitly handle this deprecated usage pattern.
36
+ msg = (
37
+ "verify should be a boolean or SSLContext, since version 0.28. "
38
+ "Use `verify=ssl.create_default_context(cafile=...)` "
39
+ "or `verify=ssl.create_default_context(capath=...)`."
40
+ )
41
+ raise RuntimeError(msg)
42
43
return verify
44
0 commit comments