File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_match_hostname.cpython-310.pyc
Back
o ;j~ � @ sr d Z ddlZddlZzddlZW n ey dZY nw dZG dd� de�Zddd�Zd d � Z dd� Z d d� ZdS )zJThe match_hostname() function from Python 3.3.3, essential when using SSL.� Nz3.5.0.1c @ s e Zd ZdS )�CertificateErrorN)�__name__� __module__�__qualname__� r r �_/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.pyr s r � c C s� g }| sdS | � d�}|d }|dd� }|�d�}||kr&tdt| � ��|s0| �� |�� kS |dkr:|�d� n|�d �sD|�d �rM|�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) �dn�hostnameZ max_wildcardsZpats�partsZleftmost� remainder� wildcards�frag�patr r r �_dnsname_match s, � r c C s&