Skip to content

Commit 43b0ea5

Browse files
committed
Merge pull request #841 from delfick/proxy_pool_manager_assert_hostname
Ensure assert_hostname is set on the pool connection
2 parents 1ca2bc5 + da33777 commit 43b0ea5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docker/ssladapter/ssladapter.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ def init_poolmanager(self, connections, maxsize, block=False):
4646

4747
self.poolmanager = PoolManager(**kwargs)
4848

49+
def get_connection(self, *args, **kwargs):
50+
"""
51+
Ensure assert_hostname is set correctly on our pool
52+
53+
We already take care of a normal poolmanager via init_poolmanager
54+
55+
But we still need to take care of when there is a proxy poolmanager
56+
"""
57+
conn = super(SSLAdapter, self).get_connection(*args, **kwargs)
58+
if conn.assert_hostname != self.assert_hostname:
59+
conn.assert_hostname = self.assert_hostname
60+
return conn
61+
4962
def can_override_ssl_version(self):
5063
urllib_ver = urllib3.__version__.split('-')[0]
5164
if urllib_ver is None:

0 commit comments

Comments
 (0)