
                         @    S SK r S SKrSSKJr  SSKJr   " S S5      rg)    N   )errors)SSLHTTPAdapterc                   >    \ rS rSrSrSrSrSrSr   SS jr	S r
Srg)	TLSConfig   a  
TLS configuration.

Args:
    client_cert (tuple of str): Path to client cert, path to client key.
    ca_cert (str): Path to CA cert file.
    verify (bool or str): This can be a bool or a path to a CA cert
        file to verify against. If ``True``, verify using ca_cert;
        if ``False`` or not specified, do not verify.
    ssl_version (int): A valid `SSL version`_.
    assert_hostname (bool): Verify the hostname of the server.

.. _`SSL version`:
    https://docs.python.org/3.5/library/ssl.html#ssl.PROTOCOL_TLSv1
Nc                    XPl         X`l        U(       a  X@l        O[        R                  U l        U(       ay   Uu  pxU(       aO  U(       aH  [        R                  R                  U5      (       a$  [        R                  R                  U5      (       d  [        R                  " S5      eXx4U l        X0l        X l        U R                  (       aW  U R                  (       aE  [        R                  R                  U R                  5      (       d  [        R                  " S5      eg g g ! [
         a    [        R                  " S5      ef = f)Nz=client_cert must be a tuple of (client certificate, key file)zRPath to a certificate and key files must be provided through the client_cert paramz.Invalid CA certificate provided for `ca_cert`.)assert_hostnameassert_fingerprintssl_versionsslPROTOCOL_TLS_CLIENT
ValueErrorr   TLSParameterErrorospathisfilecertverifyca_cert)	selfclient_certr   r   r   r
   r   tls_certtls_keys	            lib/third_party/docker/tls.py__init__TLSConfig.__init__   s     /"4 *"66D $/! "''..2J2J24''..2I2I..5  "+DI ;;4<<t||0L0L**@  1M<;#  ..6 s   D% %!Ec           	      f   U R                   Ul         U R                  (       a#  U R                  (       a  U R                  Ul        OU R                  Ul        U R                  (       a  U R                  Ul        UR	                  S[        U R                   U R                  U R                  S95        g)z,
Configure a client with these TLS options.
zhttps://)r   r
   r   N)r   r   r   r   mountr   r
   r   )r   clients     r   configure_clientTLSConfig.configure_clientL   sw     "--;;4<< LLFM KKFM99))FKZ(( 00#66"
 	    )r   r
   r   r   r   r   )NNNNNN)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r!   __static_attributes__ r#   r   r   r      s1     DGFK>B37$(-^r#   r   )r   r    r   	transportr   r   r*   r#   r   <module>r-      s    	 
  %V Vr#   