Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
ssl_.cpython-313.pyc145 linesDownload Raw Back to __pycache__
1�

2��jNE�3��%SSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J4r5 SSKJrJ
r
 SSKJrJr SrSrSrSrS	/r\\\\\\4rS6VVs0sHupU\"\US5_M snnrS(Sjr\R:(aSSKJr SS
KJ r  SSK!Jr" "SS\ SS9r#0r$S\%S'SSKrSSKJ&r&JrJ'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/JrJ0r0 \*r1\(a\"\)5(dSrSHr2\"\0\25\$\"\S\235'M SSK!Jr \RjS\6S4r7S)Sjr8S*Sjr9S+S jr:S,S-S!jjr;\RxS.S/S"jj5r=\RxS.S0S#jj5r=S1S0S$jjr=S2S%jr>S3S&jr?S4S5S'jjr@gs snnf!\3a GM6f=f!\4a Sr'Sr(Sr.Sr/S=r1r*Sr+Sr,Sr-GN1f=f)6�)�annotationsN)�	unhexlify�)�ProxySchemeUnsupported�SSLError�)�_BRACELESS_IPV6_ADDRZ_RE�_IPV4_REFzhttp/1.1))� �md5)�(�sha1)�@�sha256c�(�URS5nU$)NzOpenSSL )�7startswith)�openssl_version�8is_openssls  �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\urllib3/util/ssl_.py�(_is_has_never_check_common_name_reliablers��9!�+�+�J�7�J���)�10VerifyMode)�	TypedDict)�SSLTransportc�4�\rSrSr%S\S'S\S'S\S'Srg	)11�_TYPE_PEER_CERT_RET_DICT�.ztuple[tuple[str, str], ...]�subjectAltNamez'tuple[tuple[tuple[str, str], ...], ...]�subject�str�serialNumber�N)�__name__�12__module__�__qualname__�__firstlineno__�__annotations__�__static_attributes__r"rrrr.s��3�3�8�8��rr)�totalzdict[int, int]�_SSL_VERSION_TO_TLS_VERSION)
�
CERT_REQUIRED�HAS_NEVER_CHECK_COMMON_NAME�OP_NO_COMPRESSION�OP_NO_TICKET�OPENSSL_VERSION�PROTOCOL_TLS�PROTOCOL_TLS_CLIENT�VERIFY_X509_PARTIAL_CHAIN�VERIFY_X509_STRICT�OP_NO_SSLv2�OP_NO_SSLv3�13SSLContext�14TLSVersion)�TLSv1�TLSv1_1�TLSv1_2�	PROTOCOL_ii@ii�irc���Uc[S5eURSS5R5n[U5nU[;a[SU35e[RU5nUc[SU35e[
UR55nU"U5R5n[R"XT5(d [SUSUR5S	35eg)15z�16Checks if given fingerprint matches the supplied certificate.17 18:param cert:19    Certificate as bytes object.20:param fingerprint:21    Fingerprint as string of hexdigits, can be interspersed by colons.22NzNo certificate for the peer.�:�zFingerprint of invalid length: zAHash function implementation unavailable for fingerprint length: z&Fingerprints did not match. Expected "z", got "�")r�replace�lower�len�HASHFUNC_MAP�getr�encode�digest�hmac�compare_digest�hex)�cert�fingerprint�
digest_length�hashfunc�fingerprint_bytes�cert_digests      r�assert_fingerprintrQks����|��5�6�6��%�%�c�2�.�4�4�6�K���$�M��L�(��8��
�F�G�G����
�.�H����O�P]��_�23�	24�25"�+�"4�"4�"6�7���4�.�'�'�)�K����{�>�>��4�[�M��+�/�/�J[�I\�\]�^�26�	27�?rc��Uc[$[U[5(a)[[US5nUc[[SU-5nU$U$)a�28Resolves the argument to a numeric constant, which can be passed to29the wrap_socket function/method from the ssl module.30Defaults to :data:`ssl.CERT_REQUIRED`.31If given a string it is assumed to be the name of the constant in the32:mod:`ssl` module or its abbreviation.33(So you can specify `REQUIRED` instead of `CERT_REQUIRED`.34If it's neither `None` nor a string we assume it is already the numeric35constant which can directly be passed to wrap_socket.36N�CERT_)r+�37isinstancer �getattr�ssl��	candidate�ress  r�resolve_cert_reqsrZ�sL�������)�S�!�!��c�9�d�+���;��#�w��2�3�C��38��rc���Uc[$[U[5(aB[[US5nUc[[SU-5n[39R"[U5$U$)z40like resolve_cert_reqs41Nr;)r0rTr rUrV�typing�cast�intrWs  r�resolve_ssl_versionr_�sX�������)�S�!�!��c�9�d�+���;��#�{�Y�6�7�C��{�{�3��$�$��rc�b�[c[S5eUS[[4;asUcUb[	S5e[42R
U[R5n[43R
U[R5n[R"S[SS9 [[5nUbXGl
O[RUl
UbXWlU(aUR!U5 Uc["R$OUnUc&SnU[&-nU[(-nU[*-nU[,-nU=R.U-slUc(Sn[0R2S:�aU[4-nU[6-nU=R8U-sl[;US	S5bS44UlU["R$:Xa[>(dXl S45Ul!O
SUl!Xl SUl"S[FRH;a=[FRJRM[FRHR
S55nOSnU(aX�l'U$)
a�Creates and configures an :class:`ssl.SSLContext` instance for use with urllib3.46 47:param ssl_version:48    The desired protocol version to use. This will default to49    PROTOCOL_SSLv23 which will negotiate the highest protocol that both50    the server and your installation of OpenSSL support.51 52    This parameter is deprecated instead use 'ssl_minimum_version'.53:param ssl_minimum_version:54    The minimum version of TLS to be used. Use the 'ssl.TLSVersion' enum for specifying the value.55:param ssl_maximum_version:56    The maximum version of TLS to be used. Use the 'ssl.TLSVersion' enum for specifying the value.57    Not recommended to set to anything other than 'ssl.TLSVersion.MAXIMUM_SUPPORTED' which is the58    default value.59:param cert_reqs:60    Whether to require the certificate verification. This defaults to61    ``ssl.CERT_REQUIRED``.62:param options:63    Specific OpenSSL options. These default to ``ssl.OP_NO_SSLv2``,64    ``ssl.OP_NO_SSLv3``, ``ssl.OP_NO_COMPRESSION``, and ``ssl.OP_NO_TICKET``.65:param ciphers:66    Which cipher suites to allow the server to select. Defaults to either system configured67    ciphers if OpenSSL 1.1.1+, otherwise uses a secure default set of ciphers.68:param verify_flags:69    The flags for certificate verification operations. These default to70    ``ssl.VERIFY_X509_PARTIAL_CHAIN`` and ``ssl.VERIFY_X509_STRICT`` for Python 3.13+.71:returns:72    Constructed SSLContext object with specified options73:rtype: SSLContext74Nz7Can't create an SSLContext object without an ssl modulezZCan't specify both 'ssl_version' and either 'ssl_minimum_version' or 'ssl_maximum_version'zi'ssl_version' option is deprecated and will be removed in urllib3 v3.0. Instead use 'ssl_minimum_version'r)�category�75stacklevelr)��
�post_handshake_authTF�
SSLKEYLOGFILE)(r6�	TypeErrorr0r1�76ValueErrorr*rEr7�MINIMUM_SUPPORTED�MAXIMUM_SUPPORTED�warnings�warn�
FutureWarning�minimum_versionr:�maximum_version�set_ciphersrVr+r4r5r-r.�options�sys�version_infor2r3�verify_flagsrUre�IS_PYOPENSSL�verify_mode�check_hostname�hostname_checks_common_name�os�environ�path�77expandvars�keylog_filename)	�ssl_version�	cert_reqsrq�ciphers�ssl_minimum_version�ssl_maximum_versionrt�context�
sslkeylogfiles	         r�create_urllib3_contextr��s��N���Q�R�R��4��/B�C�C��*�.A�.M��A��
�#>�"A�"A��Z�9�9�#��#>�"A�"A��Z�9�9�#��
�M�M�M�&��	
��,�-�G��&�"5��",�"4�"4����&�"5������G�$�&/�%6��!�!�I�I������;����;���	�$�$��78	�<����O�O�w��O��������w�&��5�5�L��.�.�L����L�(���w�-�t�4�@�&*��#��C�%�%�%�l�l�'��!%���!&���'��*/�G�'��"�*�*�$����*�*�2�:�:�>�>�/�+J�K�
��
��"/���Nrc
��g�Nr"�
�sock�keyfile�certfiler�ca_certs�server_hostnamer~r��ssl_context�ca_cert_dir�key_password�ca_cert_data�79tls_in_tlss
             r�ssl_wrap_socketr�Gs��rc
��gr�r"r�s
             rr�r�Ys��(+rc
���Un
U
c80[XcUS9n
U(dU	(dU(aU
RXIU5 O$Uc![	U
S5(aU
R5 U(aU81c[
U5(a[S5eU(a'U82cU
RX!5 OU
RX!U835 U
R[5 [X
X�5nU$![an[U5UeSnAff=f)aX84All arguments except for server_hostname, ssl_context, tls_in_tls, ca_cert_data and85ca_cert_dir have the same meaning as they do when using86:func:`ssl.create_default_context`, :meth:`ssl.SSLContext.load_cert_chain`,87:meth:`ssl.SSLContext.set_ciphers` and :meth:`ssl.SSLContext.wrap_socket`.88 89:param server_hostname:90    When SNI is supported, the expected hostname of the certificate91:param ssl_context:92    A pre-made :class:`SSLContext` object. If none is provided, one will93    be created using :func:`create_urllib3_context`.94:param ciphers:95    A string of ciphers we wish the client to support.96:param ca_cert_dir:97    A directory containing CA certificates in multiple separate files, as98    supported by OpenSSL's -CApath flag or the capath argument to99    SSLContext.load_verify_locations().100:param key_password:101    Optional password if the keyfile is encrypted.102:param ca_cert_data:103    Optional string containing CA certificates in PEM format suitable for104    passing as the cadata parameter to SSLContext.load_verify_locations()105:param tls_in_tls:106    Use SSLTransport to wrap the existing socket.107N)r��load_default_certsz5Client private key is encrypted, password is required)r��load_verify_locations�OSErrorr�hasattrr��_is_key_file_encrypted�load_cert_chain�set_alpn_protocols�ALPN_PROTOCOLS�_ssl_wrap_socket_impl)r�r�r�rr�r�r~r�r�r�r�r�r�r��e�ssl_socks                rr�r�ks���P�G���)���Q���;�,�	%��)�)�(��N�108�	���2F�!G�!G��"�"�$�109�<�'�,B�7�,K�,K��N�O�O�����#�#�H�6��#�#�H�|�D����~�.�$�T�J�P�H��O��-�	%��1�+�1�$��	%�s�C�110C.�C)�)C.c���[U[5(aURS5n[[R111"U5=(d [R112"U55$)z�Detects whether the hostname given is an IPv4 or IPv6 address.113Also detects IPv6 addresses with Zone IDs.114 115:param str hostname: Hostname to examine.116:return: True if the hostname is an IP address, False otherwise.117�ascii)rT�bytes�decode�boolr118�matchr	)�hostnames r�is_ipaddressr��sD���(�E�"�"��?�?�7�+������x�(�T�,D�,J�,J�8�,T�U�Urc��[U5nUHnSU;dM SSS5 g SSS5 g!,(df   g=f)z*Detects if a key file is encrypted or not.�	ENCRYPTEDNTF)�open)�key_file�f�lines   rr�r��s<��	
�h��1��D��d�"��	119���120��
121���s�122/�/�/�123=c��U(a8[(d[S5e[R"U5 [XU5$URXS9$)Nz0TLS in TLS requires support for the 'ssl' module)r�)rr�$_validate_ssl_context_for_tls_in_tls�wrap_socket)r�r�r�r�s    rr�r��sM����|�(�B��
�	�9�9�+�F��D��?�?��"�"�4�"�I�Ir)rr �returnr�)rKzbytes | NonerLr r��None)rX�None | int | strr�r)rXr�r�r^)NNNNNNN)r~�124int | Nonerr�rqr�r��125str | Noner�r�r�r�rtr�r��ssl.SSLContext)............)r��
socket.socketr�r�r�r�rr�r�r�r�r�r~r�r�r�r��ssl.SSLContext | Noner�r�r�r�r��None | str | bytesr�ztyping.Literal[False]r�z
ssl.SSLSocket)r�r�r�r�r�r�rr�r�r�r�r�r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�� ssl.SSLSocket | SSLTransportType)NNNNNNNNNNNF)r�zstr | bytesr�r�)r�r r�r�r�)126r�r�r�r�r�r�r�r�r�r�)A�127__future__r�hashlibrHry�socketrrr\rk�binasciir�128exceptionsrr�urlr	r129r6rr,rur��tupler^r �_TYPE_VERSION_INFOrUrDr�
TYPE_CHECKINGrVrr�ssltransport�SSLTransportTyperr*r'r+r-r.r/r0r1r2r3r4r5r7�PROTOCOL_SSLv23�attr�AttributeError�ImportError�Unionr��_TYPE_PEER_CERT_RETrQrZr_r��overloadr�r�r�r�)�length�	algorithms00r�<module>r�s���"���	�
�130�
���9�3�
�131���#��������3��S�#�s�2�3��132I��H����G�G�Y��-�-�H������	��133���� �>��9�E��/1��^�0�.������ #�O�#�+S��,�,�',�#�0��	�LS��D�M�'���y���5G�(H�I�0�+��l�l�#=�u�d�#J�K��134�D�.
�"#� ���&*�&*�#�P��P��P��P��	P�135$�P�$�
P��P��P�f�������"%�!��),�!�"�'*�(+��136��
�����	�137�� �
�����'������%��&������"�������"%�!��),�!�"�'*��+�138�+�
�+��+��	+�139�+� �
+��+��+�'�+��+��+�%�+��+�&�+��+�&�� ��"&�"��)-�"�#�'+��G�140�G�
�G��G��	G�141�G� �
G��G��G�'�G��G��G�%�G��G�&�G�T142V��#'�	J�143�J��J��J� �	J�144&�J��k
��B�	��	�������L��K��K�%&�&�O�l��� '�����s<�H�-?H#�-H�145H#�H �H#�H � H#�#H?�>H?
codekingpro/portable-devtools · Team Ai