Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Use ssl.get_protocol_name() to find out which TLS version is in use #407

Merged
merged 1 commit into from
Jul 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sleekxmpp/xmlstream/xmlstream.py
Original file line number Diff line number Diff line change
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