PATH:
usr
/
lib
/
python3.8
/
site-packages
/
pip
/
_vendor
/
urllib3
/
packages
/
ssl_match_hostname
/
__pycache__
U ��.e\ � @ sx d Z ddlZddlZzddlmZ W n ek r< dZY nX dZG dd� de�Zddd �Z d d� Z dd � Zdd� ZdS )zJThe match_hostname() function from Python 3.3.3, essential when using SSL.� N)� ipaddressz3.5.0.1c @ s e Zd ZdS )�CertificateErrorN)�__name__� __module__�__qualname__� r r �c/usr/lib/python3.8/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.pyr s r � c C s� g }| sdS | � d�}|d }|dd� }|�d�}||krLtdt| � ��|s`| �� |�� kS |dkrt|�d� n>|�d �s�|�d �r�|�t�|�� n|�t�|�� d d�� |D ]}|�t�|�� q�t� dd �|� d tj�} | � |�S )zhMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F�.r r N�*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) Zdn�hostnameZ max_wildcardsZpats�partsZleftmostZ remainderZ wildcardsZfragZpatr r r �_dnsname_match s, �r c C s&