AlkantarClanX12

Your IP : 18.220.200.33


Current Path : /opt/alt/python27/lib/python2.7/site-packages/setuptools/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyc

�
��Rec@s/ddlZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZmZyddl
Z
Wnek
r�dZ
nXdddddgZd	j�j�ZyejjZejZWnek
r�eZZnXe
dk	oeeefkZydd
l
mZmZWnUek
r�y$ddlmZddlmZWq�ek
r�dZdZq�XnXes�d
efd��YZnes�dd�Zd�Zndefd��YZdefd��YZ dd�Z!d�Z"e"d��Z#d�Z$d�Z%dS(i����N(turllibthttp_clienttmaptfilter(tResolutionErrortExtractionErrortVerifyingHTTPSHandlertfind_ca_bundletis_availablet
cert_pathst
opener_fors
/etc/pki/tls/certs/ca-bundle.crt
/etc/ssl/certs/ca-certificates.crt
/usr/share/ssl/certs/ca-bundle.crt
/usr/local/share/certs/ca-root.crt
/etc/ssl/cert.pem
/System/Library/OpenSSL/certs/cert.pem
/usr/local/share/certs/ca-root-nss.crt
/etc/ssl/ca-bundle.pem
(tCertificateErrortmatch_hostname(R(RRcBseZRS((t__name__t
__module__(((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR5sic
CsRg}|stS|jd�}|d}|d}|jd�}||krgtdt|���n|s�|j�|j�kS|dkr�|jd�nY|jd�s�|jd�r�|jtj	|��n"|jtj	|�j
dd	��x$|D]}|jtj	|��q�Wtjd
dj|�dtj
�}	|	j|�S(
spMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        t.iit*s,too many wildcards in certificate DNS name: s[^.]+sxn--s\*s[^.]*s\As\.s\Z(tFalsetsplittcountRtreprtlowertappendt
startswithtretescapetreplacetcompiletjoint
IGNORECASEtmatch(
tdnthostnamet
max_wildcardstpatstpartstleftmostt	remaindert	wildcardstfragtpat((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyt_dnsname_match;s*

"
&cCs[|std��ng}|jdd
�}xC|D];\}}|dkr4t||�r_dS|j|�q4q4W|s�xc|jdd�D]L}xC|D];\}}|dkr�t||�r�dS|j|�q�q�Wq�Wnt|�dkrtd|d	jtt|��f��n;t|�dkrKtd
||df��ntd��dS(s=Verify that *cert* (in decoded format as returned by
        SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
        rules are followed, but IP addresses are not accepted for *hostname*.

        CertificateError is raised on failure. On success, the function
        returns nothing.
        sempty or no certificatetsubjectAltNametDNSNtsubjectt
commonNameis&hostname %r doesn't match either of %ss, shostname %r doesn't match %ris=no appropriate commonName or subjectAltName fields were found(((	t
ValueErrortgetR)RtlenRRRR(tcertR tdnsnamestsantkeytvaluetsub((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyRos.%cBs eZdZd�Zd�ZRS(s=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|�dS(N(t	ca_bundletHTTPSHandlert__init__(tselfR7((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR9�s	cs�j�fd�|�S(Ncst|�j|�S(N(tVerifyingHTTPSConnR7(thosttkw(R:(s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyt<lambda>�t(tdo_open(R:treq((R:s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyt
https_open�s(R
Rt__doc__R9RB(((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR�s	R;cBs eZdZd�Zd�ZRS(s@Simple verifying connection: no auth, subclasses, timeouts, etc.cKs tj|||�||_dS(N(tHTTPSConnectionR9R7(R:R<R7R=((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR9�scCs�tj|j|jft|dd��}t|d�rjt|dd�rj||_|j�|j	}n	|j}t
j|dt
jd|j
�|_yt|jj�|�Wn4tk
r�|jjtj�|jj��nXdS(Ntsource_addresst_tunnelt_tunnel_hostt	cert_reqstca_certs(tsockettcreate_connectionR<tporttgetattrtNonethasattrtsockRFRGtssltwrap_sockett
CERT_REQUIREDR7RtgetpeercertRtshutdownt	SHUT_RDWRtclose(R:RPtactual_host((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pytconnect�s$!	
	

(R
RRCR9RY(((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR;�s	cCs"tjjt|pt���jS(s@Get a urlopen() replacement that uses ca_bundle for verification(Rtrequesttbuild_openerRRtopen(R7((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR
�s	cs"tj���fd��}|S(Ncs+t�d�s$�||��_n�jS(Ntalways_returns(ROR](targstkwargs(tfunc(s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pytwrapper�s(t	functoolstwraps(R`Ra((R`s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pytonce�scsnyddl}Wntk
r$dSXd|jf�fd��Y���}|jd�|jd�|jS(Ni����tCertFilecs&eZ�fd�Z�fd�ZRS(cs't�|�j�tj|j�dS(N(tsuperR9tatexittregisterRW(R:(Re(s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR9�scs/yt�|�j�Wntk
r*nXdS(N(RfRWtOSError(R:(Re(s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyRW�s
(R
RR9RW((Re(s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyRe�stCAtROOT(twincertstoretImportErrorRNRetaddstoretname(Rlt	_wincerts((Res�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pytget_win_certfile�s
	

cCs4ttjjt�}t�p3t|d�p3t�S(s*Return an existing CA bundle path, or NoneN(	RtostpathtisfileR	RqtnextRNt_certifi_where(textant_cert_paths((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyR�s	cCs5ytd�j�SWntttfk
r0nXdS(Ntcertifi(t
__import__twhereRmRR(((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyRv�s(&RrRJRgRRbtsetuptools.extern.six.movesRRRRt
pkg_resourcesRRRQRmRNt__all__tstripRR	RZR8RDtAttributeErrortobjectRRRtbackports.ssl_match_hostnameR.R)RR;R
RdRqRRv(((s�/builddir/build/BUILDROOT/alt-python27-setuptools-36.3.0-4.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/setuptools/ssl_support.pyt<module>sP"

	



4)
#