|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /usr/local/lib/python3.6/site-packages/urllib3/util/__pycache__/ |
Upload File : |
3
G�Kd~ � @ st d Z ddlZddlZyddlZW n ek
r8 dZY nX 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 �B/tmp/pip-build-8nxjc3nm/urllib3/urllib3/util/ssl_match_hostname.pyr s r � c
C s� g }| sdS | j d�}|d }|dd� }|jd�}||krLtdt| � ��|s`| j� |j� kS |dkrt|jd� n>|jd �s�|jd �r�|jtj|�� n|jtj|�j d
d�� x|D ]}|jtj|�� q�W tj
dd
j|� d tj�} | j
|�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�hostname�
max_wildcards�pats�parts�leftmost� remainder� wildcards�frag�patr r r �_dnsname_match s*
r"