HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/docker/__pycache__/tls.cpython-310.pyc
o

�2.a��@s:ddlZddlZddlmZddlmZGdd�d�ZdS)�N�)�errors)�SSLHTTPAdapterc@s8eZdZdZdZdZdZdZ			ddd�Zdd�Z	dS)�	TLSConfiga�
    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 ``False`` or a path to a CA cert
            file.
        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	Cs�||_||_|r||_ntjdd�dkr!ttd�r!ttd�|_ntj|_|rTz|\}}Wnty9t	�
d��w|rJ|rJtj�
|�rJtj�
|�sOt	�
d��||f|_||_||_|jrl|jrntj�
|j�spt	�
d��dSdSdS)N�)rrr�PROTOCOL_TLSv1_2z=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�OPENSSL_VERSION_INFO�hasattr�getattr�PROTOCOL_TLSv1�
ValueErrorr�TLSParameterError�os�path�isfile�cert�verify�ca_cert)	�self�client_certrrr
rr	�tls_cert�tls_key�r�,/usr/lib/python3/dist-packages/docker/tls.py�__init__s>	���
��
��zTLSConfig.__init__cCsT|j|_|jr|jr|j|_n|j|_|jr|j|_|�dt|j|j|jd��dS)z<
        Configure a client with these TLS options.
        zhttps://)r
rr	N)r
rrr�mountrrr	)r�clientrrr�configure_client^s
�zTLSConfig.configure_client)NNNNNN)
�__name__�
__module__�__qualname__�__doc__rrrr
rr!rrrrrs
�Br)rr�r�	transportrrrrrr�<module>s