Skip to content
Snippets Groups Projects
Commit ba5e8038 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Merge branch 'use-highest-ssl-version' into 'master'

Use highest SSL version supported by both sides

See merge request esr/irker!10
parents 0de9a1e5 3f8c2186
No related branches found
No related tags found
No related merge requests found
...@@ -246,8 +246,9 @@ class IRCServerConnection(): ...@@ -246,8 +246,9 @@ class IRCServerConnection():
self.master = master self.master = master
self.socket = None self.socket = None
# PROTOCOL_SSLv23 selects the highest version that both client and server support
def _wrap_socket(self, socket, target, certfile=None, cafile=None, def _wrap_socket(self, socket, target, certfile=None, cafile=None,
protocol=ssl.PROTOCOL_TLSv1): protocol=ssl.PROTOCOL_SSLv23):
try: # Python 3.2 and greater try: # Python 3.2 and greater
ssl_context = ssl.SSLContext(protocol) ssl_context = ssl.SSLContext(protocol)
except AttributeError: # Python < 3.2 except AttributeError: # Python < 3.2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment