관리-도구
편집 파일: ssl_match_hostname.cpython-311.pyc
� �܋f � �L � d Z ddlmZ ddlZdZ G d� de� � Zd d�Zd � ZdS )zHThe match_hostname() function from Python 3.2, essential when using SSL.� )�absolute_importNz3.2.2c � � e Zd ZdS )�CertificateErrorN)�__name__� __module__�__qualname__� � �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/utils/ssl_match_hostname.pyr r s � � � � � ��Dr r � c �h � g }| sdS | � d� � }|d }|� d� � }||k rt dt | � � z � � �|s*| � � � |� � � k S |dk r|� d� � n�|� d� � s|� d� � r(|� t j |� � � � n;|� t j |� � � dd � � � � |d d� D ])}|� t j |� � � � �*t j dd � |� � z dz t j � � }|� |� � S )zhMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F�.r �*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*r Nz\Az\.z\Z)�split�countr �repr�lower�append� startswith�re�escape�replace�compile�join� IGNORECASE�match) �dn�hostname� max_wildcards�pats�parts�leftmost� wildcards�frag�pats r �_dnsname_matchr&