hmm no this isnt how you ask for cert validation apparently
This commit is contained in:
parent
80b941fa53
commit
8245a411c0
1 changed files with 1 additions and 10 deletions
|
@ -1,13 +1,4 @@
|
|||
import ssl
|
||||
|
||||
def tls_context(verify: bool=True) -> ssl.SSLContext:
|
||||
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
||||
context.options |= ssl.OP_NO_SSLv2
|
||||
context.options |= ssl.OP_NO_SSLv3
|
||||
context.options |= ssl.OP_NO_TLSv1
|
||||
context.load_default_certs()
|
||||
|
||||
if verify:
|
||||
context.verify_mode = ssl.CERT_REQUIRED
|
||||
|
||||
return context
|
||||
return ssl.create_default_context()
|
||||
|
|
Loading…
Add table
Reference in a new issue