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:
commit
c23e20bc29
@ -250,7 +250,12 @@ class myHTTPSConnection(M2Crypto.httpslib.HTTPSConnection):
|
|||||||
M2Crypto.httpslib.HTTPSConnection.__init__(self, *args, **kwargs)
|
M2Crypto.httpslib.HTTPSConnection.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
def connect(self, *args):
|
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)
|
verify_certificate(self)
|
||||||
|
|
||||||
def getHost(self):
|
def getHost(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user