HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/urllib3/util/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/urllib3/util/__pycache__/ssl_match_hostname.cpython-311.pyc
�

-�c~��z�dZddlZddlZ	ddlZn
#e$rdZYnwxYwdZGd�de��Zdd�Zd�Z	d	�Z
d
�ZdS)zJThe match_hostname() function from Python 3.3.3, essential when using SSL.�Nz3.5.0.1c��eZdZdS)�CertificateErrorN)�__name__�
__module__�__qualname__���A/usr/lib/python3/dist-packages/urllib3/util/ssl_match_hostname.pyrrs�������Dr	r�c�l�g}|sdS|�d��}|d}|dd�}|�d��}||krtdt|��z���|s*|���|���kS|dkr|�d��n�|�d	��s|�d	��r(|�tj|����n;|�tj|���	d
d����|D])}|�tj|�����*tj
dd
�|��zdztj��}	|	�
|��S)zhMatching according to RFC 6125, section 6.4.3

    http://tools.ietf.org/html/rfc6125#section-6.4.3
    F�.rrN�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr�repr�lower�append�
startswith�re�escape�replace�compile�join�
IGNORECASE�match)
�dn�hostname�
max_wildcards�pats�parts�leftmost�	remainder�	wildcards�frag�pats
          r
�_dnsname_matchr&s���
�D�
���u�
�H�H�T�N�N�E��Q�x�H��a�b�b�	�I����s�#�#�I��=� � �
�:�T�"�X�X�E�
�
�	
�
�.��x�x�z�z�X�^�^�-�-�-�-�
�3���	
���G�����	�	�	�V�	$�	$�A��(;�(;�F�(C�(C�A�
	
���B�I�h�'�'�(�(�(�(�	
���B�I�h�'�'�/�/��w�?�?�@�@�@��%�%�����B�I�d�O�O�$�$�$�$�
�*�U�U�Z�Z��-�-�-��5�r�}�
E�
E�C��9�9�X���r	c�t�t|t��r"tjdkrt	|dd���}|S)N)��ascii�strict)�encoding�errors)�
isinstance�str�sys�version_info�unicode)�objs r
�_to_unicoder3Os:���#�s���>�� 0�4� 7� 7��c�G�H�=�=�=���Jr	c�t�tjt|�������}||kS)z�Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    )�	ipaddress�
ip_addressr3�rstrip)�ipname�host_ip�ips   r
�_ipaddress_matchr;Vs2��
�	�k�&�1�1�8�8�:�:�	;�	;�B�
��=�r	c��|std���	tjt|����}n/#ttf$rd}Ynt
$rt�d}n�YnwxYwg}|�dd��}|D]f\}}|dkr+|�t||��rdS|�|���6|dkr*|�t||��rdS|�|���g|sP|�dd��D]9}|D]4\}}|dkr)t||��rdS|�|���5�:t|��d	kr;td
|�dd�tt|���������t|��d	krtd
|�d
|d�����td���)a)Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function
    returns nothing.
    ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDN�subjectAltNamer�DNSz
IP Address�subject�
commonNamerz	hostname z doesn't match either of z, z doesn't match rz=no appropriate commonName or subjectAltName fields were found)�
ValueErrorr5r6r3�UnicodeError�AttributeError�getr&rr;�lenrr�mapr)�certrr9�dnsnames�san�key�value�subs        r
�match_hostnamerMbsJ���
��
-�
�
�	
�
��&�{�8�'<�'<�=�=�����*�%����
�����������G�G��
�G������H�
�(�(�#�R�
(�
(�C��#�#�
��U��%�<�<���>�%��#B�#B������O�O�E�"�"�"�"�
�L�
 �
 ��"�'7��w�'G�'G�"�����O�O�E�"�"�"���
+��8�8�I�r�*�*�	+�	+�C�!�
+�
+�
��U��,�&�&�%�e�X�6�6�������O�O�E�*�*�*��

+��8�}�}�q�����,4�H�H�d�i�i��D�(�@S�@S�6T�6T�6T�
V�
�
�	
�

�X���!�	�	������8�TU�;�;�W�X�X�X��K�
�
�	
s�!5�A!�
A!� A!)r)�__doc__rr/r5�ImportError�__version__rArr&r3r;rMrr	r
�<module>rQs���P�P�

�	�	�	�
�
�
�
�������������I�I�I�������	�	�	�	�	�z�	�	�	�3�3�3�3�l���	�	�	�=
�=
�=
�=
�=
s���