File: //usr/lib/python3/dist-packages/setuptools/__pycache__/ssl_support.cpython-39.pyc
a
��`u! � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dl m
Z
mZ zd dlZW n e
yj dZY n0 g d�Zd�� �� ZzejjZejjZW n ey� e ZZY n0 eduo�eeefvZzd dlmZmZ W nN e
�y& zd dlmZ d dlmZ W n e
�y dZdZY n0 Y n0 e�s>G dd � d e�Ze�sVddd�Zd
d� ZG dd� de�ZG dd� de�Zddd�Z dd� Z!e!dd� �Z"dd� Z#dd� Z$dS )� N)�ResolutionError�ExtractionError)�VerifyingHTTPSHandler�find_ca_bundle�is_available�
cert_paths�
opener_fora
/etc/pki/tls/certs/ca-bundle.crt
/etc/ssl/certs/ca-certificates.crt
/usr/share/ssl/certs/ca-bundle.crt
/usr/local/share/certs/ca-root.crt
/etc/ssl/cert.pem
/System/Library/OpenSSL/certs/cert.pem
/usr/local/share/certs/ca-root-nss.crt
/etc/ssl/ca-bundle.pem
)�CertificateError�match_hostname)r )r
c @ s e Zd ZdS )r N)�__name__�
__module__�__qualname__� r r �8/usr/lib/python3/dist-packages/setuptools/ssl_support.pyr 7 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 )zqMatching according to RFC 6125, section 6.4.3
https://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"