Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/urllib3/contrib/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/urllib3/contrib/__pycache__/securetransport.cpython-311.pyc

�

�܋fI��
��UdZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddl	m	ZddlmZddlmZmZdd	lmZmZmZmZmZmZmZejd
ed���e
j rddl!m"Z"d
dgZ#ej$j%Z&ej'��Z(de)d<ej*��Z+dZ,ej$j-ej.ej/fej$j0ej.ej/fiZ1e2e
d��rej3ej3fe1e
j4<e2e
d��rej5ej5fe1e
j6<e2e
d��rej.ej.fe1e
j7<e2e
d��rej8ej8fe1e
j9<e2e
d��rej/ej/fe1e
j:<e
j;j<ej.e
j;j=ej.e
j;j>ej8e
j;j?ej/e
j;j@ej/iZAde)d<d4d�ZBd4d�ZCd5d"�ZDd5d#�ZEejFeD��ZGejHeE��ZIGd$�d%��ZJ		d6d7d1�ZKeKeJ_KGd2�d3��ZLdS)8a�	
SecureTranport support for urllib3 via ctypes.

This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not capable of doing TLSv1.2. The only way to resolve
this is to give macOS users an alternative solution to the problem, and that
solution is to use SecureTransport.

We use ctypes here because this solution must not require a compiler. That's
because pip is not allowed to require a compiler either.

This is not intended to be a seriously long-term solution to this problem.
The hope is that PEP 543 will eventually solve this issue for us, at which
point we can retire this contrib module. But in the short term, we need to
solve the impending tire fire that is Python on Mac without this kind of
contrib module. So...here we are.

To use this module, simply import and inject it::

    import urllib3.contrib.securetransport
    urllib3.contrib.securetransport.inject_into_urllib3()

Happy TLSing!

This code is a bastardised version of the code found in Will Bond's oscrypto
library. An enormous debt is owed to him for blazing this trail for us. For
that reason, this code should be considered to be covered both by urllib3's
license and by oscrypto's:

.. code-block::

    Copyright (c) 2015-2016 Will Bond <will@wbond.net>

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
�)�annotationsN)�socket�)�util�)�CoreFoundation�Security)�
SecurityConst�_assert_no_error�_build_tls_unknown_ca_alert�_cert_array_from_pem�_create_cfstring_array�_load_client_cert_chain�_temporary_keychainz�'urllib3.contrib.securetransport' module is deprecated and will be removed in urllib3 v2.1.0. Read more in this issue: https://github.com/urllib3/urllib3/issues/2681)�category�
stacklevel)�Literal�inject_into_urllib3�extract_from_urllib3z/weakref.WeakValueDictionary[int, WrappedSocket]�_connection_refsi@�PROTOCOL_SSLv2�PROTOCOL_SSLv3�PROTOCOL_TLSv1�PROTOCOL_TLSv1_1�PROTOCOL_TLSv1_2zdict[int, int]�_tls_version_to_st�return�Nonec��tt_ttj_dt_dtj_dS)zG
    Monkey-patch urllib3 with SecureTransport-backed SSL-support.
    TN)�SecureTransportContextr�
SSLContext�ssl_�IS_SECURETRANSPORT���p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/urllib3/contrib/securetransport.pyrr�s-��-�D�O�1�D�I��"�D��#'�D�I� � � r%c��tt_ttj_dt_dtj_dS)z>
    Undo monkey-patching by :func:`inject_into_urllib3`.
    FN)�orig_util_SSLContextrr!r"r#r$r%r&rr�s-��+�D�O�/�D�I��#�D��#(�D�I� � � r%�
connection_id�int�data_buffer�data_length_pointer�	bytearrayc�4�d}	t�|��}|�tjS|j}|d}|���}d}d}	||kr�|�|dkr/t
j||��sttj
d���||z
}	tj|	z�
||z��}
|�|
|	��}||z
}|s|stjSn||k��ng#t$rZ}|j	}|�G|tj
kr7||d<|tjks|tjkrtjcYd}~S�Yd}~nd}~wwxYw||d<||krtjSdS#t($r}|�||_tjcYd}~Sd}~wwxYw)zs
    SecureTransport read callback. This is called by ST to request that data
    be returned from the socket.
    Nr�	timed out)r�getr
�errSSLInternalr�
gettimeoutr�
wait_for_read�OSError�errno�EAGAIN�ctypes�c_char�from_address�	recv_into�errSSLClosedGraceful�
ECONNRESET�EPIPE�errSSLClosedAbort�errSSLWouldBlock�	Exception�
_exception)
r)r+r,�wrapped_socket�base_socket�requested_length�timeout�error�
read_count�	remaining�buffer�
chunk_size�es
             r&�_read_callbackrL�s
���N�.,�)�-�-�m�<�<���!� �/�/�$�+��.�q�1�� �+�+�-�-�����
�	��/�/�/��?�g��l�l��-�k�7�C�C�A�%�e�l�K�@�@�@�,�z�9�	� �-�)�3�A�A��*�,����)�2�2�6�9�E�E�
��j�(�
�!��%�B�,�A�A���/�/�/����	�	�	��G�E�� �U�e�l�%:�%:�)3�#�A�&��E�,�,�,����0D�0D�(�:�:�:�:�:�:�:�����������	����",��A���)�)�)� �1�1��q���,�,�,��%�()�N�%��+�+�+�+�+�+�+�����,���sf�'E.�'E.�BC.�&C.�-E.�.
E�8A	E
�E�E.�E
�E.�
E�E.�.
F�8F�F�Fc��d}	t�|��}|�tjS|j}|d}tj||��}|���}d}d}		|	|kra|�|dkr/tj	||��sttjd���|�
|��}
|	|
z
}	||
d�}|	|k�ang#t$rZ}|j}|�G|tjkr7|	|d<|tjks|tjkrtjcYd}~S�Yd}~nd}~wwxYw|	|d<|	|krtjSdS#t$$r}|�||_tjcYd}~Sd}~wwxYw)zx
    SecureTransport write callback. This is called by ST to request that data
    actually be sent on the network.
    Nrr/)rr0r
r1rr7�	string_atr2r�wait_for_writer4r5r6�sendr<r=r>r?r@rA)r)r+r,rBrC�bytes_to_write�datarErF�sent�
chunk_sentrKs            r&�_write_callbackrU�s����N�*,�)�-�-�m�<�<���!� �/�/�$�+��,�Q�/�����^�<�<�� �+�+�-�-������	���'�'��?�g��l�l��.�{�G�D�D�A�%�e�l�K�@�@�@�(�-�-�d�3�3�
��
�"���J�K�K�(����'�'����	�	�	��G�E�� �U�e�l�%:�%:�)-�#�A�&��E�,�,�,����0D�0D�(�:�:�:�:�:�:�:�����������	����"&��A���>�!�!� �1�1��q���,�,�,��%�()�N�%��+�+�+�+�+�+�+�����,���s`�'E�<E�)A'C�E�
D5�A	D0�$D5�%E�*D0�+E�0D5�5E�
E:�E5�/E:�5E:c���eZdZdZd9d�Zejd:d���Zd;d�Zd<d�Z	d=d�Z
d>d�Zd?d�Zd@d �Z
dAd"�Z	dBdCd(�ZdDd+�ZdEd-�ZdFd/�ZdGd0�Zd@d1�Zd@d2�Zd@d3�ZdHdId6�ZdJd8�Zd#S)K�
WrappedSocketzO
    API-compatibility wrapper for Python's OpenSSL wrapped socket object.
    r�
socket_clsrrc���||_d|_d|_d|_d|_d|_d|_d|_d|_|j�	��|_
|j�d��dS�NrF)r�context�_io_refs�_closed�_real_closedrA�	_keychain�
_keychain_dir�_client_cert_chainr2�_timeout�
settimeout)�selfrs  r&�__init__zWrappedSocket.__init__;sw����������
����!���,0������)-���"&�����.�.�0�0��
�����q�!�!�!�!�!r%�"typing.Generator[None, None, None]c#�xK�d|_dV�|j�%|jdc}|_|���|�dS)a]
        A context manager that can be used to wrap calls that do I/O from
        SecureTransport. If any of the I/O callbacks hit an exception, this
        context manager will correctly propagate the exception after the fact.
        This avoids silently swallowing those exceptions.

        It also correctly forces the socket closed.
        N)rA�_real_close)rd�	exceptions  r&�_raise_on_errorzWrappedSocket._raise_on_errorNsQ�������
	�����?�&�)-��$�&�I�t���������O�'�&r%�	protocols�list[bytes] | Nonec���|sdSt|��}	tj|j|��}t	|��tj|��dS#tj|��wxYw)z<
        Sets up the ALPN protocols on the context.
        N)rr	�SSLSetALPNProtocolsr[rr�	CFRelease)rdrk�
protocols_arr�results    r&�_set_alpn_protocolsz!WrappedSocket._set_alpn_protocolscss���	��F�.�y�9�9�
�	4��1�$�,�
�N�N�F��V�$�$�$��$�]�3�3�3�3�3��N�$�]�3�3�3�3���s�)A�A*�verify�bool�trust_bundle�bytes | Nonec�6�|r|�dStjtjf}	|�|��}||vrdSdt	|����}d}n#t
$r}d|��}|}Yd}~nd}~wwxYwt
|�����}|j�	|��tjddd��}	|j�tj
tj|	��|���t!jd|����|�)z�
        Called when we have set custom validation. We do this in two cases:
        first, when cert validation is entirely disabled; and second, when
        using a custom trust DB.
        Raises an SSLError if the connection is not trusted.
        Nzerror code: zexception: �iirrzcertificate verify failed, )r
�kSecTrustResultUnspecified�kSecTrustResultProceed�_evaluate_trustr*r@r�versionr�sendall�struct�pack�
setsockopt�
SOL_SOCKET�	SO_LINGERrh�ssl�SSLError)
rdrsru�	successes�trust_result�reason�excrK�rec�optss
          r&�_custom_validatezWrappedSocket._custom_validateps9���	��-��F�
�4��0�
�	�		��/�/��=�=�L��y�(�(���7�C��$5�$5�7�7�F��C�C���	�	�	�(�1�(�(�F��C�C�C�C�C�C�����	����*�$�,�,�.�.�9�9������C� � � ��{�4��A�&�&������v�0�&�2B�D�I�I�I��������l�A��A�A�B�B��Ks�A�A�
A+�A&�&A+�bytesr*c��tj�|��r<t|d��5}|���}ddd��n#1swxYwYd}tj��}	t|��}tj|j	tj|����}t|��|stjd���tj||��}t|��tj|d��}t|��tj��}tj|tj|����}t|��|rt'j|��|�t'j|��n2#|rt'j|��|�t'j|��wwxYw|jS)N�rbzFailed to copy trust referenceT)�os�path�isfile�open�readr	�SecTrustRefr
�SSLCopyPeerTrustr[r7�byrefrr�r��SecTrustSetAnchorCertificates�!SecTrustSetAnchorCertificatesOnly�SecTrustResultType�SecTrustEvaluaterro�value)rdru�f�
cert_array�trustrqr�s       r&r{zWrappedSocket._evaluate_trust�s���
�7�>�>�,�'�'�	(��l�D�)�)�
(�Q� �v�v�x�x��
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(��
��$�&�&��	5�-�l�;�;�J��.�t�|�V�\�%�=P�=P�Q�Q�F��V�$�$�$��
E��l�#C�D�D�D��;�E�:�N�N�F��V�$�$�$��?��t�L�L�F��V�$�$�$�#�6�8�8�L��.�u�f�l�<�6P�6P�Q�Q�F��V�$�$�$��
0��(��/�/�/��%��(��4�4�4���	�
0��(��/�/�/��%��(��4�4�4�4�&�����!�!s�A�A�A�2C1F�/F?�server_hostname�bytes | str | None�min_version�max_version�client_cert�
str | None�
client_key�client_key_passphrase�
typing.Any�alpn_protocolsc
���tjdtjtj��|_tj|jtt��}
t|
��t5t|��dz}|tvr|dzdz}|tv�|t|<ddd��n#1swxYwYtj
|j|��}
t|
��|rat|t��s|�d��}tj|j|t%|����}
t|
��|�|	��tj|j|��}
t|
��tj|j|��}
t|
��|r|�4tj|jtjd��}
t|
��|rdt1��\|_|_t7|j||��|_tj|j|j��}
t|
��	|���5tj|j��}
|
tj krtCj"d���|
tj#kr#|�$||��	ddd����t|
��	ddd��dS#1swxYwY��)z�
        Actually performs the TLS handshake. This is run automatically by
        wrapped socket, and shouldn't be needed in user code.
        Ni���rzutf-8Tzhandshake timed out)%r	�SSLCreateContextr
�kSSLClientSide�kSSLStreamTyper[�
SSLSetIOFuncs�_read_callback_pointer�_write_callback_pointerr�_connection_ref_lock�idr�SSLSetConnection�
isinstancer��encode�SSLSetPeerDomainName�lenrr�SSLSetProtocolVersionMin�SSLSetProtocolVersionMax�SSLSetSessionOption�"kSSLSessionOptionBreakOnServerAuthrr_r`rra�SSLSetCertificaterj�SSLHandshaker?rrE�errSSLServerAuthCompletedr�)rdr�rsrur�r�r�r�r�r�rq�handles            r&�	handshakezWrappedSocket.handshake�sz��$ �0��-�.�
�0L�
�
����'��L�0�2I�
�
��	�� � � �
"�	,�	,���X�X�
�*�F��,�,�,� �1�*�
�2���,�,�,�'+��V�$�		,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,��*�4�<��@�@���� � � �
�	%��o�u�5�5�
B�"1�"8�"8��"A�"A���2���o�s�?�/C�/C���F�
�V�$�$�$�	
� � ��0�0�0��2�4�<��M�M���� � � ��2�4�<��M�M���� � � ��	%��1��1���m�N�PT���F�
�V�$�$�$��	%�1D�1F�1F�.�D�N�D�.�&=����Z�'�'�D�#��/���d�>U�V�V�F��V�$�$�$�	��%�%�'�'�

�

�!�.�t�|�<�<���]�;�;�;� �.�)>�?�?�?��}�F�F�F��)�)�&�,�?�?�?��

�

�

�

�

�

�

�%�V�,�,�,��

�

�

�

�

�

�

�

�

�

�

�

����

�

�

�

�	s+�+7B.�.B2�5B2�A%K-�K-�-K1�4K1c�4�|j���S�N)r�fileno�rds r&r�zWrappedSocket.filenos���{�!�!�#�#�#r%c�v�|jdkr|xjdzc_|jr|���dSdS)Nrr)r\r]�closer�s r&�_decref_socketioszWrappedSocket._decref_socketiossD���=�1����M�M�Q��M�M��<�	��J�J�L�L�L�L�L�	�	r%�bufsizc��tj|��}|�||��}|d|�}tjt
|��Sr�)r7�create_string_bufferr:�typing�castr�)rdr�rI�
bytes_readrRs     r&�recvzWrappedSocket.recv#sE���,�V�4�4���^�^�F�F�3�3�
��k�z�k�"���{�5�$�'�'�'r%NrI�ctypes.Array[ctypes.c_char]�nbytes�
int | Nonec	�@�|jrdS|�t|��}tj|z�|��}tjd��}|���5tj|j	||tj
|����}ddd��n#1swxYwY|tjkr |j
dkrtjd���n>|tjtjfvr|���nt'|��|j
S)Nrzrecv timed out)r^r�r7r8�from_buffer�c_size_trjr	�SSLReadr[r�r
r?r�rrEr;�errSSLClosedNoNotifyrhr)rdrIr��processed_bytesrqs     r&r:zWrappedSocket.recv_into)sa����	��1��>���[�[�F��-�&�(�5�5�f�=�=�� �/�!�,�,��
�
!�
!�
#�
#�	�	��%���f�f�f�l�?�.K�.K���F�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��]�3�3�3�
�$��)�)��n�%5�6�6�6�*���.��.�
�
�
�
��������V�$�$�$��$�$s�%/B � B$�'B$rE�floatc��||_dSr��rb)rdrEs  r&rczWrappedSocket.settimeoutVs
����
�
�
r%�float | Nonec��|jSr�r�r�s r&r2zWrappedSocket.gettimeoutYs
���}�r%rRc	��tjd��}|���5tj|j|t
|��tj|����}ddd��n#1swxYwY|tj	kr|j
dkrtjd���t|��|j
S)Nrzsend timed out)r7r�rjr	�SSLWriter[r�r�r
r?r�rrEr)rdrRr�rqs    r&rPzWrappedSocket.send\s��� �/�!�,�,��
�
!�
!�
#�
#�	�	��&���d�C��I�I�v�|�O�/L�/L���F�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�]�3�3�3��8M�QR�8R�8R��.�!1�2�2�2��V�$�$�$��$�$s�<A1�1A5�8A5c��d}|t|��kr?|�|||tz���}||z
}|t|��k�=dSdS�Nr)r�rP�SSL_WRITE_BLOCKSIZE)rdrR�
total_sentrSs    r&r}zWrappedSocket.sendallmsb���
��3�t�9�9�$�$��9�9�T�*�z�<O�/O�"O�P�Q�Q�D��$��J��3�t�9�9�$�$�$�$�$�$r%c��|���5tj|j��ddd��dS#1swxYwYdSr�)rjr	�SSLCloser[r�s r&�shutdownzWrappedSocket.shutdownss���
�
!�
!�
#�
#�	,�	,���d�l�+�+�+�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,s�<�A�Ac�V�d|_|jdkr|���dSdS)NTr)r]r\rhr�s r&r�zWrappedSocket.closews6������=�A������������r%c��d|_|jr tj|j��d|_|jr tj|j��d|_|jrYt
j|j��tj|j��tj	|j
��dx|_|_
|j���S)NT)
r^r[rrorar_r	�SecKeychainDelete�shutil�rmtreer`rr�r�s r&rhzWrappedSocket._real_close}s��� ����<�	 ��$�T�\�2�2�2��D�L��"�	+��$�T�%<�=�=�=�&*�D�#��>�	7��&�t�~�6�6�6��$�T�^�4�4�4��M�$�,�-�-�-�26�6�D�N�T�/��{� � �"�"�"r%F�binary_formc�\�|std���tj��}d}d}	tj|jtj|����}t|��|s1	|rtj	|��|rtj	|��dSdStj
|��}|s1	|rtj	|��|rtj	|��dSdStj|d��}|sJ�tj|��}|sJ�tj
|��}tj|��}	tj|	|��}|rtj	|��|rtj	|��n2#|rtj	|��|rtj	|��wwxYw|S)Nz2SecureTransport only supports dumping binary certsr)�
ValueErrorr	r�r�r[r7r�rrro�SecTrustGetCertificateCount�SecTrustGetCertificateAtIndex�SecCertificateCopyData�CFDataGetLength�CFDataGetBytePtrrN)
rdr�r��certdata�	der_bytesrq�
cert_count�leaf�data_lengthr+s
          r&�getpeercertzWrappedSocket.getpeercert�s���(�	S��Q�R�R�R��$�&�&�����	�	0��.�t�|�V�\�%�=P�=P�Q�Q�F��V�$�$�$��
��&�
3��(��2�2�2��
0��(��/�/�/�/�/�
0�
0�'"�=�e�D�D�J��
���
3��(��2�2�2��
0��(��/�/�/�/�/�
0�
0��9�%��C�C�D��K�K�4� �6�t�<�<�H��O�O�8�(�8��B�B�K�(�9�(�C�C�K��(��k�B�B�I��
3��(��2�2�2��
0��(��/�/�/����
3��(��2�2�2��
0��(��/�/�/�/�
0�����s�=E:�E:�A.E:�:/F)�strc��tj��}tj|jt	j|����}t
|��|jtj	krtjd���|jtjkrdS|jtj
krdS|jtjkrdS|jtjkrdS|jtjkrdStjd|�����)Nz(SecureTransport does not support TLS 1.3zTLSv1.2zTLSv1.1�TLSv1�SSLv3�SSLv2zUnknown TLS version: )r	�SSLProtocol�SSLGetNegotiatedProtocolVersionr[r7r�rr�r
�kTLSProtocol13r�r��kTLSProtocol12�kTLSProtocol11�
kTLSProtocol1�
kSSLProtocol3�
kSSLProtocol2)rd�protocolrqs   r&r|zWrappedSocket.version�s����'�)�)���9��L�&�,�x�0�0�
�
��	�� � � ��>�]�9�9�9��,�I�J�J�J�
�^�}�;�
;�
;��9�
�^�}�;�
;�
;��9�
�^�}�:�
:�
:��7�
�^�}�:�
:�
:��7�
�^�}�:�
:�
:��7��,�C�x�C�C�D�D�Dr%)rrXrr)rrf)rkrlrr)rsrtrurvrr)rur�rr*)r�r�rsrtrurvr�r*r�r*r�r�r�r�r�r�r�rlrr�rr*�rr)r�r*rr�r�)rIr�r�r�rr*)rEr�rr)rr�)rRr�rr*)rRr�rr)F)r�rtrrv)rr�)�__name__�
__module__�__qualname__�__doc__re�
contextlib�contextmanagerrjrrr�r{r�r�r�r�r:rcr2rPr}r�r�rhr�r|r$r%r&rWrW6s���������"�"�"�"�&��������(4�4�4�4�#L�#L�#L�#L�J&"�&"�&"�&"�PZ�Z�Z�Z�x$�$�$�$�����(�(�(�(�IM�+%�+%�+%�+%�+%�Z � � � �����%�%�%�%�"����,�,�,�,�����
#�
#�
#�
#�8�8�8�8�8�tE�E�E�E�E�Er%rW�rrdrX�mode�ILiteral['r'] | Literal['w'] | Literal['rw'] | Literal['wr'] | Literal['']�	bufferingr��argsr��kwargs�typing.BinaryIO | typing.TextIOc�4�d}tj|||g|�Ri|��Sr�)rX�makefile)rdrrrrs     r&rr�s.���I���t�T�9�F�t�F�F�F�v�F�F�Fr%c��eZdZdZd5d�Zed6d���Zejd7d���Zed8d���Zejd9d
���Zed8d���Z	e	jd9d���Z	d:d�Z
d:d�Zd;d�Z			d<d=d�Z
		d>d?d�Zd@d"�Z				dAdBd.�Zed8d/���ZejdCd1���Zed8d2���ZejdDd4���ZdS)Er z�
    I am a wrapper class for the SecureTransport library, to translate the
    interface of the standard library ``SSLContext`` object to calls into
    SecureTransport.
    rr*rrc�*�tjj|_tjj|_|dtjtjfvrt|\|_	|_
d|_d|_d|_
d|_d|_d|_d|_dSrZ)r��
TLSVersion�MINIMUM_SUPPORTED�_minimum_version�MAXIMUM_SUPPORTED�_maximum_version�PROTOCOL_TLS�PROTOCOL_TLS_CLIENT�_protocol_to_min_max�_min_version�_max_version�_options�_verify�
_trust_bundle�_client_cert�_client_key�_client_key_passphrase�_alpn_protocols)rdrs  r&rezSecureTransportContext.__init__�s���%(�^�%E���%(�^�%E����D�#�"2�C�4K�L�L�L�3G��3Q�0�D��t�0���
����+/���(,���'+���&*��#�37����r%�
Literal[True]c��dS)��
        SecureTransport cannot have its hostname checking disabled. For more,
        see the comment on getpeercert() in this file.
        Tr$r�s r&�check_hostnamez%SecureTransportContext.check_hostnames	���tr%r�r�c��dS)r,Nr$�rdr�s  r&r-z%SecureTransportContext.check_hostnames���r%c��|jSr��r#r�s r&�optionszSecureTransportContext.optionss���}�r%c��||_dSr�r1r/s  r&r2zSecureTransportContext.optionss����
�
�
r%c�@�|jrtjntjSr�)r$r��
CERT_REQUIRED�	CERT_NONEr�s r&�verify_modez"SecureTransportContext.verify_mode!s��$(�L�C�s� � �c�m�Cr%c�0�|tjk|_dSr�)r�r5r$r/s  r&r7z"SecureTransportContext.verify_mode%s���� 1�1����r%c��dSr�r$r�s r&�set_default_verify_pathsz/SecureTransportContext.set_default_verify_paths)s	��	
�r%c�*�|���Sr�)r:r�s r&�load_default_certsz)SecureTransportContext.load_default_certs5s���,�,�.�.�.r%�ciphersc� �td���)Nz5SecureTransport doesn't support custom cipher strings)r�)rdr=s  r&�set_ciphersz"SecureTransportContext.set_ciphers8s���P�Q�Q�Qr%N�cafiler��capath�cadatarvc��|�td���|�(t|��5	ddd��n#1swxYwY|p||_dS)Nz1SecureTransport does not support cert directories)r�r�r%)rdr@rArBs    r&�load_verify_locationsz,SecureTransportContext.load_verify_locations;s������P�Q�Q�Q����f���
�
��
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�$�-�v����s�1�5�5�certfiler��keyfile�passwordc�0�||_||_||_dSr�)r&r'�_client_cert_passphrase)rdrErFrGs    r&�load_cert_chainz&SecureTransportContext.load_cert_chainLs"��%���"���'/��$�$�$r%rk�list[str | bytes]c�p�ttd��std���d�|D��|_dS)z�
        Sets the ALPN protocols that will later be set on the context.

        Raises a NotImplementedError if ALPN is not supported.
        rnz2SecureTransport supports ALPN only in macOS 10.12+c�N�g|]"}tj�|d����#S)�ascii)r�to_bytes)�.0�ps  r&�
<listcomp>z=SecureTransportContext.set_alpn_protocols.<locals>.<listcomp>`s*��R�R�R�1��	� 2� 2�1�g� >� >�R�R�Rr%N)�hasattrr	�NotImplementedErrorr))rdrks  r&�set_alpn_protocolsz)SecureTransportContext.set_alpn_protocolsVsK���x�!6�7�7�	�%�D���
� S�R�	�R�R�R����r%FT�sockrX�server_sidert�do_handshake_on_connect�suppress_ragged_eofsr�r�rWc���|rJ�|sJ�|sJ�t|��}|�||j|jt|jt|j|j|j|j	|j
�	�	|Sr�)rWr�r$r%rrrr&r'r(r))rdrVrWrXrYr�rBs       r&�wrap_socketz"SecureTransportContext.wrap_socketbs�������&�&�&�&�#�#�#�#�'�t�,�,��	� � ���L����t�4�5��t�4�5������'�� �
	
�
	
�
	
��r%c��|jSr��rr�s r&�minimum_versionz&SecureTransportContext.minimum_version�����$�$r%r^c��||_dSr�r])rdr^s  r&r^z&SecureTransportContext.minimum_version���� /����r%c��|jSr��rr�s r&�maximum_versionz&SecureTransportContext.maximum_version�r_r%rdc��||_dSr�rc)rdrds  r&rdz&SecureTransportContext.maximum_version�rar%)rr*rr)rr*)r�r�rrr)r�r*rrr)r=r�rr)NNN)r@r�rAr�rBrvrr)NN)rEr�rFr�rGr�rr)rkrKrr)FTTN)rVrXrWrtrXrtrYrtr�r�rrW)r^r*rr)rdr*rr)rr	r
rre�propertyr-�setterr2r7r:r<r?rDrJrUr[r^rdr$r%r&r r �sM��������8�8�8�8������X���������������X��
�^�����^���D�D�D��X�D���2�2�2���2�

�

�

�

�/�/�/�/�R�R�R�R�
"�!�#�	.�.�.�.�.�(#�#�	0�0�0�0�0�
S�
S�
S�
S�"�(,�%)�.2�
�����B�%�%�%��X�%���0�0�0���0��%�%�%��X�%���0�0�0���0�0�0r%r r)r)r*r+r*r,r-rr*)rN)rdrXrrrr�rr�rr�rr)Mr�
__future__rrr7r5�os.pathr�r�rr�r~�	threadingr��warnings�weakrefrX�r�_securetransport.bindingsrr	�_securetransport.low_levelr
rrr
rrr�warn�DeprecationWarning�
TYPE_CHECKING�typing_extensionsr�__all__r"r!r(�WeakValueDictionaryr�__annotations__�Lockr�r�rrrrr rSrrrrrrrrrrr��TLSv1_1�TLSv1_2rrrrrLrU�SSLReadFuncr��SSLWriteFuncr�rWrr r$r%r&�<module>r|s���4�4�4�l#�"�"�"�"�"�����
�
�
�
���������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�����
�
�
�
���������'�'�'�'�'�'�����������������������������������
�5� ������
��*�)�)�)�)�)�)� �"8�
9���y�+��( �G��!�!��"�"�"�"�&�y�~�'�'����	�I��]�8�-�:V�W��I�!��#��$�$����7�3� �!�!���#��#�0���+�,��7�3� �!�!���#��#�0���+�,��7�3� �!�!���#��#�0���+�,��7�3�"�#�#���$��$�2���-�.��7�3�"�#�#���$��$�2���-�.��N�$�m�&A��N��-�5��N��M�8��N��M�8��N�$�m�&B�&������(�(�(�(�)�)�)�)�6,�6,�6,�6,�r2,�2,�2,�2,�p.��-�n�=�=��/�(�/��@�@��cE�cE�cE�cE�cE�cE�cE�cE�T
	� �G�G�G�G�G�"�
��c0�c0�c0�c0�c0�c0�c0�c0�c0�c0r%

Hacked By AnonymousFox1.0, Coded By AnonymousFox