관리-도구
편집 파일: ssl_.cpython-310.pyc
o ƚReC � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ d dl m Z mZmZ ddl mZmZmZmZ ddlmZ dd lmZmZ dZdZd Zd Zd ZdgZe eed�Zd d� Zeede�Z zd dl!Z!d dl!m"Z"m#Z# W n e$yv Y nw zd dl!mZ W n e$y� Y nw zddl%mZ W n e$y� Y nw z d dl!m&Z& e&Z'W n! e$y� z d dl!m'Z& e&Z'W n e$y� d Z'Z&Y nw Y nw zd dl!m(Z( W n e$y� e&Z(Y nw zd dl!m)Z)m*Z*m+Z+ W n e$y� d\Z*Z+dZ)Y nw zd dl!m,Z, W n e$�y dZ,Y nw d�-g d��Z.zd dl!mZ W n e$�y- G dd� de/�ZY nw d d!� Z0d"d#� Z1d$d%� Z2 d0d&d'�Z3 d1d(d)�Z4d*d+� Z5d,d-� Z6d2d.d/�Z7dS )3� )�absolute_importN)�hexlify� unhexlify)�md5�sha1�sha256� )�InsecurePlatformWarning�ProxySchemeUnsupported�SNIMissingWarning�SSLError)�six� )�BRACELESS_IPV6_ADDRZ_RE�IPV4_REFzhttp/1.1)� �( �@ c C sD t t| �t|� �}tt| �t|��D ] \}}|||A O }q|dkS )z� Compare two digests of equal length in constant time. The digests must be of type str/bytes. Returns True if the digests match, and False otherwise. r )�abs�len�zip� bytearray)�a�b�result�left�right� r ��/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_.py�_const_compare_digest_backport s r �compare_digest)� CERT_REQUIRED�wrap_socket)�HAS_SNI)�SSLTransport)�PROTOCOL_TLS)�PROTOCOL_SSLv23)�PROTOCOL_TLS_CLIENT)�OP_NO_COMPRESSION�OP_NO_SSLv2�OP_NO_SSLv3)i i i )�OP_NO_TICKETi @ �:)zECDHE+AESGCMzECDHE+CHACHA20z DHE+AESGCMzDHE+CHACHA20zECDH+AESGCMz DH+AESGCMzECDH+AESzDH+AESz RSA+AESGCMzRSA+AESz!aNULLz!eNULLz!MD5z!DSS)� SSLContextc @ s8 e Zd Zdd� Zdd� Zd dd�Zdd � Zddd�ZdS )r- c C s6 || _ d| _tj| _d | _d| _d | _d | _d | _ d S )NFr ) �protocol�check_hostname�ssl� CERT_NONE�verify_mode�ca_certs�options�certfile�keyfile�ciphers)�selfZprotocol_versionr r r �__init__� s zSSLContext.__init__c C s || _ || _d S �N)r5 r6 )r8 r5 r6 r r r �load_cert_chain� s zSSLContext.load_cert_chainNc C s* || _ |d urtd��|d urtd��d S )Nz-CA directories not supported in older Pythonsz&CA data not supported in older Pythons)r3 r )r8 �cafile�capath�cadatar r r �load_verify_locations� s �z SSLContext.load_verify_locationsc C s || _ d S r: �r7 )r8 Zcipher_suiter r r �set_ciphers� s zSSLContext.set_ciphersFc C s>