ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/setuptools/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyc

�
�/{Yc@sNddlZddlZddlZddlZddlZddlmZmZddlmZyddl	Z	Wne
k
r�dZ	nXdddddgZd	j
�j�ZeZZxmd
ddgfd
ddgffD]G\ZZx8eD]0ZydeefdUWq�e
k
r$q�Xq�Wq�We	dk	oHeeefkZyddl	mZmZWnUe
k
r�y$ddlmZddlmZWq�e
k
r�dZdZq�XnXes�defd��YZnes�dd�Zd�Zndefd��YZdefd��YZdd�Zdad�Z d�Z!dS(i����N(tResolutionErrortExtractionError(turllib2tVerifyingHTTPSHandlertfind_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
tHTTPSHandlerRsurllib.requesttHTTPSConnectionthttplibshttp.clientsfrom %s import %s(tCertificateErrortmatch_hostname(R(RRcBseZRS((t__name__t
__module__(((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR8sic
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((sG/opt/alt/python33/lib/python3.3/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)RtlenRRtmapR(tcertR tdnsnamestsantkeytvaluetsub((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyRps.%cBs eZdZd�Zd�ZRS(s=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|�dS(N(t	ca_bundleRt__init__(tselfR8((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR9�s	cs�j�fd�|�S(Ncst|�j|�S(N(tVerifyingHTTPSConnR8(thosttkw(R:(sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyt<lambda>�s(tdo_open(R:treq((R:sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyt
https_open�s(R
Rt__doc__R9RA(((sG/opt/alt/python33/lib/python3.3/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(R	R9R8(R:R<R8R=((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR9�scCs�tj|j|jft|dd��}t|d�rat|dd�ra||_|j�nt	j
|dt	jd|j�|_yt
|jj�|j�Wn4tk
r�|jjtj�|jj��nXdS(Ntsource_addresst_tunnelt_tunnel_hostt	cert_reqstca_certs(tsockettcreate_connectionR<tporttgetattrtNonethasattrtsockRDtssltwrap_sockett
CERT_REQUIREDR8RtgetpeercertRtshutdownt	SHUT_RDWRtclose(R:RN((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pytconnect�s$!	


(R
RRBR9RV(((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR;�s	cCstjt|pt���jS(s@Get a urlopen() replacement that uses ca_bundle for verification(Rtbuild_openerRRtopen(R8((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR�scsttdk	rtjSyddlm�Wntk
r;dSXd�f�fd��Y}|dddg�atjS(Ni����(tCertFilet
MyCertFilecseZdd�fd�ZRS(csL�j|�x|D]}|j|�qW|j|�tj|j�dS(N(R9taddstoretaddcertstatexittregisterRU(R:tstorestcertststore(RY(sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR9�s



(((R
RR9((RY(sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyRZ�sR_tCAtROOT(t	_wincertsRLtnametwincertstoreRYtImportError(RZ((RYsG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pytget_win_certfile�s
cCsstjdkrt�Sx$tD]}tjj|�r|SqWytjdd�SWntt	t
fk
rndSXdS(s*Return an existing CA bundle path, or Nonetnttcertifis
cacert.pemN(tosReRhRtpathtisfilet
pkg_resourcestresource_filenameRgRRRL(t	cert_path((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyR�s
("RkRHR]RRnRRtsetuptools.compatRRORgRLt__all__tstripRRtobjectRR	twhattwheretmoduleRRRtbackports.ssl_match_hostnameR.R)RR;RRdRhR(((sG/opt/alt/python33/lib/python3.3/site-packages/setuptools/ssl_support.pyt<module>sV

	





4)
	

Zerion Mini Shell 1.0