@@ -10,7 +10,7 @@ class TLSConfig(object):
10
10
ssl_version = None
11
11
12
12
def __init__ (self , client_cert = None , ca_cert = None , verify = None ,
13
- ssl_version = None ):
13
+ ssl_version = None , assert_hostname = None ):
14
14
# Argument compatibility/mapping with
15
15
# http://docs.docker.com/examples/https/
16
16
# 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,
20
20
# urllib3 sets a default ssl_version if ssl_version is None
21
21
# http://tinyurl.com/kxga8hb
22
22
self .ssl_version = ssl_version
23
+ self .assert_hostname = assert_hostname
23
24
24
25
# "tls" and "tls_verify" must have both or neither cert/key files
25
26
# In either case, Alert the user when both are expected, but any are
@@ -65,4 +66,7 @@ def configure_client(self, client):
65
66
client .verify = self .verify
66
67
if self .cert :
67
68
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