mirror of https://github.com/jesopo/ircrobots
hmm no this isnt how you ask for cert validation apparently
This commit is contained in:
parent
80b941fa53
commit
8245a411c0
|
@ -1,13 +1,4 @@
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
def tls_context(verify: bool=True) -> ssl.SSLContext:
|
def tls_context(verify: bool=True) -> ssl.SSLContext:
|
||||||
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
return ssl.create_default_context()
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in New Issue