관리-도구
편집 파일: _ddr.cpython-38.pyc
U /?�f � @ s� d dl Z d dlZd dlmZ d dlZd dlZd dlZd dlZd dl Zd dl Zej�d�Z G dd� d�Zdd� Zdd � Zd d� ZdS )� N)�urlparsez_dns.resolver.arpac @ s6 e Zd Zdd� Zdd� Zdd� Zdd� Zdd d�Zd S ) � _SVCBInfoc C s || _ || _|| _|| _d S �N)�bootstrap_address�port�hostname�nameservers)�selfr r r r � r �6/opt/hc_python/lib/python3.8/site-packages/dns/_ddr.py�__init__ s z_SVCBInfo.__init__c C s. |d D ] \}}|dkr|| j kr dS qdS )zIVerify that the _SVCBInfo's address is in the cert's subjectAltName (SAN)�subjectAltNamez IP AddressTF)r )r �cert�name�valuer r r �ddr_check_certificate! s z_SVCBInfo.ddr_check_certificatec C s t jj}|�� }|jj|_|S r )�dns�query�ssl�create_default_context� TLSVersion�TLSv1_2�minimum_version)r r �ctxr r r �make_tls_context( s z_SVCBInfo.make_tls_contextc C s� | � � }t�� | }t�| j| jf|��b}|j|| jd��F}|�t j �|�� |�� |� � }| �|�W 5 Q R � W 5 Q R � S Q R X W 5 Q R X d S )N)�server_hostname)r �time�socket�create_connectionr r �wrap_socketr � settimeoutr r � _remaining�do_handshake�getpeercertr )r �lifetimer � expiration�s�tsr r r r �ddr_tls_check_sync. s �z_SVCBInfo.ddr_tls_check_syncNc � s� |d krt j�� }| �� }t�� | }|�t j�| j�t j dd | j| jf||| j�I d H 4 I d H �6}|� t j�|��I d H }| �|�W 5 Q I d H R � S Q I d H R X d S )Nr )r ZasyncbackendZget_default_backendr r Zmake_socket�inetZaf_for_addressr r �SOCK_STREAMr r r# r r! r )r r$ �backendr r% r'