ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/setuptools/
Upload File :
Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyc

�
�Yc@s
ddlZddlZddlZddlZddlZddlZddlmZmZddlm	Z	yddl
Z
Wnek
r�dZ
nXdddddgZ
d	j�j�ZeZZxmd
ddgfd
ddgffD]G\ZZx8eD]0ZydeefdUWqek
r0qXqWq�We
dk	oTeeefkZyddlmZWn5ek
r�eede��Zedd�ZnXddlmZmZdefd��YZdefd��YZdd�Z da!d�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(tcreate_connectiont_GLOBAL_DEFAULT_TIMEOUTc
Cs�|\}}d}x�tj||dtj�D]�}|\}}}	}
}d}y\tj|||	�}|tk	r�|j|�n|r�|j|�n|j|�|SWq.tk
r�t	}|dk	r�|j
�q�q.Xq.W|r��ntd��dS(s�Connect to *address* and return the socket object.

        Convenience function.  Connect to *address* (a 2-tuple ``(host,
        port)``) and return the socket object.  Passing the optional
        *timeout* parameter will set the timeout on the socket instance
        before attempting to connect.  If no *timeout* is supplied, the
        global default timeout setting returned by :func:`getdefaulttimeout`
        is used.  If *source_address* is set it must be a tuple of (host, port)
        for the socket to bind as a source address before making the connection.
        An host of '' or port 0 tells the OS to use the default.
        is!getaddrinfo returns an empty listN(tNonetsockettgetaddrinfotSOCK_STREAMRt
settimeouttbindtconnectterrortTruetclose(
taddressttimeouttsource_addressthosttportterrtrestaftsocktypetprotot	canonnametsatsock((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR0s(
"

(tCertificateErrortmatch_hostnamecBs eZdZd�Zd�ZRS(s=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|�dS(N(t	ca_bundleRt__init__(tselfR&((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR'qs	cs�j�fd�|�S(Ncst|�j|�S(N(tVerifyingHTTPSConnR&(Rtkw(R((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt<lambda>ws(tdo_open(R(treq((R(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt
https_openus(t__name__t
__module__t__doc__R'R.(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRns	R)cBs eZdZd�Zd�ZRS(s@Simple verifying connection: no auth, subclasses, timeouts, etc.cKs tj|||�||_dS(N(R	R'R&(R(RR&R*((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR'}scCs�t|j|jft|dd��}t|d�rgt|dd�rg||_|j�|j}n	|j}t	j
|dt	jd|j�|_yt
|jj�|�Wn4tk
r�|jjtj�|jj��nXdS(NRt_tunnelt_tunnel_hostt	cert_reqstca_certs(RRRtgetattrR
thasattrR#R2R3tssltwrap_sockett
CERT_REQUIREDR&R%tgetpeercertR$tshutdownRt	SHUT_RDWRR(R(R#tactual_host((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR�s$!	
	

(R/R0R1R'R(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR){s	cCstjt|pt���jS(s@Get a urlopen() replacement that uses ca_bundle for verification(Rtbuild_openerRRtopen(R&((s:/usr/lib/python2.7/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(R'taddstoretaddcertstatexittregisterR(R(tstorestcertststore(RA(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR'�s



(((R/R0R'((RA(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRB�sRGtCAtROOT(t	_wincertsR
tnametwincertstoreRAtImportError(RB((RAs:/usr/lib/python2.7/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(tosRMRPRtpathtisfilet
pkg_resourcestresource_filenameRORRR
(t	cert_path((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR�s
($tsysRSRREtreRVRRtsetuptools.compatRR8ROR
t__all__tstriptsplitRtobjectRR	twhattwheretmoduleRRR6Rtbackports.ssl_match_hostnameR$R%RR)RRLRPR(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt<module>sB<

	




$
!	

Zerion Mini Shell 1.0