o
    Nrf	  ã                   @   s&   d dl Z ddlmZ G dd„ dƒZdS )é    Né   )Úerrorsc                   @   s.   e Zd ZdZdZdZdZddd„Zdd„ ZdS )Ú	TLSConfigaj  
    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.
    Nc                 C   sœ   |r0z|\}}W n t y   t d¡d ‚w |r&|r&tj |¡r&tj |¡s+t d¡‚||f| _|| _|| _| jrH| jrJtj | j¡sLt d¡‚d S d S d S )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`.)	Ú
ValueErrorr   ZTLSParameterErrorÚosÚpathÚisfileÚcertÚverifyÚca_cert)ÚselfÚclient_certr   r
   Ztls_certZtls_key© r   úS/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/docker/tls.pyÚ__init__   s0   ÿýÿ
ÿÿ
ÿÿzTLSConfig.__init__c                 C   s4   | j r| jr| j|_ n| j |_ | jr| j|_dS dS )z<
        Configure a client with these TLS options.
        N)r
   r   r	   )r   Úclientr   r   r   Úconfigure_client9   s   
ÿzTLSConfig.configure_client)NNN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r
   r   r   r   r   r   r   r      s    

$r   )r   Ú r   r   r   r   r   r   Ú<module>   s    