관리-도구
편집 파일: ssl_.cpython-37.pyc
B ��` C � @ 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 yd dl!Z!d dl!m"Z"m#Z# W n e$k r� Y nX yd dl!mZ W n e$k �r Y nX yddl%mZ W n e$k �r> Y nX yd dl!m&Z& e&Z'W nJ e$k �r� yd dl!m'Z& e&Z'W n e$k �r� d Z'Z&Y nX Y nX yd dl!m(Z( W n e$k �r� e&Z(Y nX yd dl!m)Z)m*Z*m+Z+ W n" e$k �r d\Z*Z+dZ)Y nX yd dl!m,Z, W n e$k �r2 dZ,Y nX d�-ddddd d!d"d#d$d%d&d'd(d)g�Z.yd 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 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�left�right� r �B/opt/alt/python37/lib/python3.7/site-packages/urllib3/util/ssl_.py�_const_compare_digest_backport s r Zcompare_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�sslZ CERT_NONE�verify_mode�ca_certs�options�certfile�keyfile�ciphers)�selfZprotocol_versionr r r �__init__� s zSSLContext.__init__c C s || _ || _d S )N)r3 r4 )r6 r3 r4 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)r1 r )r6 ZcafileZcapathZcadatar r r �load_verify_locations� 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>