@@ -10,7 +10,7 @@ class TLSConfig(object):
1010 ssl_version = None
1111
1212 def __init__ (self , client_cert = None , ca_cert = None , verify = None ,
13- ssl_version = None ):
13+ ssl_version = None , assert_hostname = None ):
1414 # Argument compatibility/mapping with
1515 # http://docs.docker.com/examples/https/
1616 # This diverges from the Docker CLI in that users can specify 'tls'
@@ -20,6 +20,7 @@ def __init__(self, client_cert=None, ca_cert=None, verify=None,
2020 # urllib3 sets a default ssl_version if ssl_version is None
2121 # http://tinyurl.com/kxga8hb
2222 self .ssl_version = ssl_version
23+ self .assert_hostname = assert_hostname
2324
2425 # "tls" and "tls_verify" must have both or neither cert/key files
2526 # In either case, Alert the user when both are expected, but any are
@@ -65,4 +66,7 @@ def configure_client(self, client):
6566 client .verify = self .verify
6667 if self .cert :
6768 client .cert = self .cert
68- client .mount ('https://' , ssladapter .SSLAdapter (self .ssl_version ))
69+ client .mount ('https://' , ssladapter .SSLAdapter (
70+ ssl_version = self .ssl_version ,
71+ assert_hostname = self .assert_hostname ,
72+ ))
0 commit comments