Skip to content

Commit

Permalink
Use ssl.get_protocol_name() to find out which TLS version is in use (…
Browse files Browse the repository at this point in the history
…allows the latest TLS versions to be used as well as any future versions).
  • Loading branch information
SnijderC committed May 2, 2016
1 parent 4305edd commit 6ebcf6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sleekxmpp/xmlstream/xmlstream.py
Expand Up @@ -464,7 +464,7 @@ def _connect(self, reattempt=True):
if self.reconnect_delay is None:
delay = 1.0
self.reconnect_delay = delay

if reattempt:
delay = min(self.reconnect_delay * 2, self.reconnect_max_delay)
delay = random.normalvariate(delay, delay * 0.1)
Expand Down Expand Up @@ -839,8 +839,10 @@ def start_tls(self):
to be restarted.
"""
log.info("Negotiating TLS")
ssl_versions = {3: 'TLS 1.0', 1: 'SSL 3', 2: 'SSL 2/3'}
log.info("Using SSL version: %s", ssl_versions[self.ssl_version])
log.info(
"Using SSL version: %s",
ssl.get_protocol_name(self.ssl_version).replace('PROTOCOL_', '', 1)
)
if self.ca_certs is None:
cert_policy = ssl.CERT_NONE
else:
Expand Down

0 comments on commit 6ebcf6b

Please sign in to comment.