Kaydet (Commit) 43b0ea53 authored tarafından Joffrey F's avatar Joffrey F

Merge pull request #841 from delfick/proxy_pool_manager_assert_hostname

Ensure assert_hostname is set on the pool connection
...@@ -46,6 +46,19 @@ class SSLAdapter(HTTPAdapter): ...@@ -46,6 +46,19 @@ class SSLAdapter(HTTPAdapter):
self.poolmanager = PoolManager(**kwargs) self.poolmanager = PoolManager(**kwargs)
def get_connection(self, *args, **kwargs):
"""
Ensure assert_hostname is set correctly on our pool
We already take care of a normal poolmanager via init_poolmanager
But we still need to take care of when there is a proxy poolmanager
"""
conn = super(SSLAdapter, self).get_connection(*args, **kwargs)
if conn.assert_hostname != self.assert_hostname:
conn.assert_hostname = self.assert_hostname
return conn
def can_override_ssl_version(self): def can_override_ssl_version(self):
urllib_ver = urllib3.__version__.split('-')[0] urllib_ver = urllib3.__version__.split('-')[0]
if urllib_ver is None: if urllib_ver is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment