관리-도구
편집 파일: ssl_.cpython-36.pyc
3 �Re�8 � 1 @ s( d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ d dl m Z mZmZ ddl mZmZ ddlmZmZmZ dd lmZ dZd Zd Zd Ze eed�Zdd � Zeede�Zy(d dlZd dlmZm Z d dlmZ W n e!k r� Y nX yd dlm"Z" e"Z#W nJ e!k �rL yd dlm#Z" e"Z#W n e!k �rF d Z#Z"Y nX Y nX yd dlm$Z$m%Z%m&Z& W n" e!k �r� d7\Z$Z%dZ&Y nX dj'ddddddddd d!d"d#d$d%g�Z(yd d&lmZ W n& e!k �r� G d'd(� d(e)�ZY nX d)d*� Z*d+d,� Z+d-d.� Z,d8d/d0�Z-d9d1d2�Z.d3d4� Z/d5d6� Z0dS ):� )�absolute_importN)�hexlify� unhexlify)�md5�sha1�sha256� )�IPV4_RE�BRACELESS_IPV6_ADDRZ_RE� )�SSLError�InsecurePlatformWarning�SNIMissingWarning)�sixF)� �( �@ c C sH t t| �t|� �}x*tt| �t|��D ]\}}|||A O }q(W |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�l�r� r ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/urllib3/util/ssl_.py�_const_compare_digest_backport s r �compare_digest)�wrap_socket� CERT_REQUIRED)�HAS_SNI)�PROTOCOL_TLS)�PROTOCOL_SSLv23)�OP_NO_SSLv2�OP_NO_SSLv3�OP_NO_COMPRESSION� � i �: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__k s zSSLContext.__init__c C s || _ || _d S )N)r3 r4 )r6 r3 r4 r r r �load_cert_chainv 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)r1 r )r6 �cafile�capath�cadatar r r �load_verify_locationsz s z SSLContext.load_verify_locationsc C s || _ d S )N)r5 )r6 Zcipher_suiter r r �set_ciphers� s zSSLContext.set_ciphersFc C s>