%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/
Upload File :
Create Path :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyc

�
�wMVc@sddlmZmZddlmZmZddlmZyXdZ	e
ZddlZddlm
Z
mZmZddlm	Z	ddlmZWnek
r�nXd	�Zd
�Zd�Ze	dk	r�ddddddd�Znddddddd
�ZdS(i����(thexlifyt	unhexlify(tmd5tsha1i(tSSLErrorN(twrap_sockett	CERT_NONEtPROTOCOL_SSLv23(t
SSLContext(tHAS_SNIcCs�itd6td6}|jdd�j�}tt|�d�\}}|sY||krhtd��nt|j��}||}||�j	�}||ks�tdj
t|�t|����ndS(	s�
    Checks if given fingerprint matches the supplied certificate.

    :param cert:
        Certificate as bytes object.
    :param fingerprint:
        Fingerprint as string of hexdigits, can be interspersed by colons.
    iit:tis!Fingerprint is of invalid length.s6Fingerprints did not match. Expected "{0}", got "{1}".N(RRtreplacetlowertdivmodtlenRRtencodetdigesttformatR(tcerttfingerprintthashfunc_mapt
digest_lengthtresttfingerprint_bytesthashfunctcert_digest((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pytassert_fingerprints

		cCs[|dkrtSt|t�rWtt|d�}|dkrSttd|�}n|S|S(s�
    Resolves the argument to a numeric constant, which can be passed to
    the wrap_socket function/method from the ssl module.
    Defaults to :data:`ssl.CERT_NONE`.
    If given a string it is assumed to be the name of the constant in the
    :mod:`ssl` module or its abbrevation.
    (So you can specify `REQUIRED` instead of `CERT_REQUIRED`.
    If it's neither `None` nor a string we assume it is already the numeric
    constant which can directly be passed to wrap_socket.
    tCERT_N(tNoneRt
isinstancetstrtgetattrtssl(t	candidatetres((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pytresolve_cert_reqs8scCs[|dkrtSt|t�rWtt|d�}|dkrSttd|�}n|S|S(s 
    like resolve_cert_reqs
    t	PROTOCOL_N(RRRRR R!(R"R#((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pytresolve_ssl_versionOsc
Cs�t|�}||_d}|j|O_|rfy|j|�Wqftk
rb}	t|	��qfXn|r|j||�ntr�|j|d|�S|j|�S(s�
        All arguments except `server_hostname` have the same meaning as for
        :func:`ssl.wrap_socket`

        :param server_hostname:
            Hostname of the expected certificate
        itserver_hostname(	Rtverify_modetoptionstload_verify_locationst	ExceptionRtload_cert_chainR	R(
tsocktkeyfiletcertfilet	cert_reqstca_certsR'tssl_versiontcontexttOP_NO_COMPRESSIONte((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pytssl_wrap_socket`s
	cCs(t|d|d|d|d|d|�S(NR.R/R1R0R2(R(R-R.R/R0R1R'R2((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyR6�s(tbinasciiRRthashlibRRt
exceptionsRRRtFalseR	R!RRRtImportErrorRR$R&R6(((s`/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyt<module>s*
	%				

Zerion Mini Shell 1.0