관리-도구
편집 파일: ssl_.cpython-38.pyc
U &?�fC � @ 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$k r� Y nX zd dl!mZ W n e$k �r Y nX zddl%mZ W n e$k �r> Y nX zd dl!m&Z& e&Z'W nJ e$k �r� zd dl!m'Z& e&Z'W n e$k �r� d Z'Z&Y nX Y nX zd dl!m(Z( W n e$k �r� e&Z(Y nX zd dl!m)Z)m*Z*m+Z+ W n" e$k �r d\Z*Z+dZ)Y nX zd dl!m,Z, W n e$k �r2 dZ,Y nX d�-ddddd d!d"d#d$d%d&d'd(d)g�Z.zd d*l!mZ W n& e$k �r� G d+d,� d,e/�ZY nX d-d.� Z0d/d0� Z1d1d2� Z2d=d3d4�Z3d>d5d6�Z4d7d8� Z5d9d:� Z6d?d;d<�Z7dS )@� )�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 �K/opt/hc_python/lib/python3.8/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 k rtd��|d k r&td��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>