1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

Merge pull request #166 from OlegGirko/add-tls-sni

Add support for TLS SNI if M2Crypto supports it.
This commit is contained in:
Adrian Schröter 2015-08-13 13:28:25 +02:00
commit c23e20bc29

View File

@ -250,7 +250,12 @@ class myHTTPSConnection(M2Crypto.httpslib.HTTPSConnection):
M2Crypto.httpslib.HTTPSConnection.__init__(self, *args, **kwargs)
def connect(self, *args):
M2Crypto.httpslib.HTTPSConnection.connect(self, *args)
self.sock = SSL.Connection(self.ssl_ctx)
if self.session:
self.sock.set_session(self.session)
if hasattr(self.sock, 'set_tlsext_host_name'):
self.sock.set_tlsext_host_name(self.host)
self.sock.connect((self.host, self.port))
verify_certificate(self)
def getHost(self):