Fix SSLError in incoming connection with python 3.10

This commit is contained in:
Lee Miller 2023-03-28 05:30:21 +03:00
parent 42995c5ca7
commit 761c95d561
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
1 changed files with 4 additions and 1 deletions

View File

@ -190,7 +190,10 @@ class Connection(threading.Thread):
'Initializing TLS connection with %s:%s',
self.host_print, self.port)
context = ssl.create_default_context()
context = ssl.create_default_context(
purpose=ssl.Purpose.CLIENT_AUTH if self.server
else ssl.Purpose.SERVER_AUTH
)
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE