Error on verify as str. (#3418)
This commit is contained in:
parent
47f4a96ffa
commit
ce7e14da27
@ -31,6 +31,14 @@ def create_ssl_context(verify: ssl.SSLContext | bool = True) -> ssl.SSLContext:
|
||||
ssl_context.check_hostname = False
|
||||
ssl_context.verify_mode = ssl.CERT_NONE
|
||||
return ssl_context
|
||||
elif isinstance(verify, str): # pragma: nocover
|
||||
# Explicitly handle this deprecated usage pattern.
|
||||
msg = (
|
||||
"verify should be a boolean or SSLContext, since version 0.28. "
|
||||
"Use `verify=ssl.create_default_context(cafile=...)` "
|
||||
"or `verify=ssl.create_default_context(capath=...)`."
|
||||
)
|
||||
raise RuntimeError(msg)
|
||||
|
||||
return verify
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user