Skip to content

Commit

Permalink
fix authenticators import on platforms without ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Sergachev committed Jul 24, 2021
1 parent 846a68e commit f86b862
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rpyc/utils/authenticators.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SSLAuthenticator(object):
"""

def __init__(self, keyfile, certfile, ca_certs=None, cert_reqs=None,
ssl_version=ssl.PROTOCOL_TLS, ciphers=None):
ssl_version=None, ciphers=None):
self.keyfile = str(keyfile)
self.certfile = str(certfile)
self.ca_certs = str(ca_certs) if ca_certs else None
Expand All @@ -70,7 +70,10 @@ def __init__(self, keyfile, certfile, ca_certs=None, cert_reqs=None,
self.cert_reqs = ssl.CERT_NONE
else:
self.cert_reqs = cert_reqs
self.ssl_version = ssl_version
if ssl_version is None:
self.ssl_version = ssl.PROTOCOL_TLS
else:
self.ssl_version = ssl_version

def __call__(self, sock):
kwargs = dict(keyfile=self.keyfile, certfile=self.certfile,
Expand Down

0 comments on commit f86b862

Please sign in to comment.