mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-24 02:04:09 +03:00
Small fix to requests sessions context creation
This commit is contained in:
parent
31104c3fc2
commit
636b72a471
@ -60,12 +60,12 @@ def createClientSslContext(verify: bool = True) -> ssl.SSLContext:
|
||||
if verify:
|
||||
sslContext = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=certifi.where())
|
||||
else:
|
||||
sslContext = (
|
||||
ssl._create_unverified_context()
|
||||
) # pylint: disable=protected-access
|
||||
sslContext = ssl._create_unverified_context(purpose=ssl.Purpose.SERVER_AUTH, check_hostname=False)
|
||||
|
||||
|
||||
# Disable TLS1.0 and TLS1.1
|
||||
sslContext.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
|
||||
# Redundant, only use minimum_version
|
||||
# sslContext.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
|
||||
sslContext.minimum_version = ssl.TLSVersion.TLSv1_2
|
||||
return sslContext
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user