/usr/lib/python2.7/site-packages/urllib3/util
NameSizeModeActions
connection.py46390644editdlrm
connection.pyc38380644editdlrm
connection.pyo38380644editdlrm
queue.py4970644editdlrm
queue.pyc13110644editdlrm
queue.pyo13110644editdlrm
request.py37050644editdlrm
request.pyc37090644editdlrm
request.pyo37090644editdlrm
response.py25860644editdlrm
response.pyc23470644editdlrm
response.pyo23470644editdlrm
retry.py151600644editdlrm
retry.pyc145690644editdlrm
retry.pyo145690644editdlrm
ssl_.py132570644editdlrm
ssl_.pyc112870644editdlrm
ssl_.pyo112870644editdlrm
timeout.py97570644editdlrm
timeout.pyc95840644editdlrm
timeout.pyo95840644editdlrm
url.py67990644editdlrm
url.pyc66290644editdlrm
url.pyo66290644editdlrm
wait.py54030644editdlrm
wait.pyc41340644editdlrm
wait.pyo41340644editdlrm
__init__.py10440644editdlrm
__init__.pyc12650644editdlrm
__init__.pyo12650644editdlrm
Edit: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyc (11287B)
ó nf·\c@@s½ddlmZddlZddlZddlZddlZddlmZmZddl m Z m Z m Z ddl mZmZmZddlmZdZeZeZeZie d6e d 6e d 6Zd „Zeed eƒZy<ddlZdd lmZmZm Z ddlmZWne!k r;nXy ddlm"Z"m#Z#m$Z$Wn#e!k rd0\Z"Z#dZ$nXe%edƒrej&Z&n6yddl'Z'd„Z&Wne!k rÒd„Z&nXdj(dddddddddd d!d"d#d$d%d&gƒZ)ydd'lmZWn3e!k r[ddl*Z*d(e+fd)„ƒYZnXd*„Z,d+„Z-d,„Z.ddddd-„Z/dddddddddd.„ Z0d/„Z1dS(1i(tabsolute_importN(thexlifyt unhexlify(tmd5tsha1tsha256i(tSSLErrortInsecurePlatformWarningtSNIMissingWarning(tsixi i(i@cC@s`tt|ƒt|ƒƒ}x7tt|ƒt|ƒƒD]\}}|||AO}q8W|dkS(s§ 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. i(tabstlentzipt bytearray(tatbtresulttltr((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyt_const_compare_digest_backports(tcompare_digest(t wrap_sockett CERT_NONEtPROTOCOL_SSLv23(tHAS_SNI(t OP_NO_SSLv2t OP_NO_SSLv3tOP_NO_COMPRESSIONiiit inet_ptoncC@s.t|tƒr!|jdƒ}ntj|ƒS(Ntascii(t isinstancetbytestdecodet ipaddresst ip_address(t_thost((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyRDscC@s tj|ƒS(N(tsockett inet_aton(R#R$((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyRJst:sTLS13-AES-256-GCM-SHA384sTLS13-CHACHA20-POLY1305-SHA256sTLS13-AES-128-GCM-SHA256s ECDH+AESGCMs ECDH+CHACHA20s DH+AESGCMs DH+CHACHA20s ECDH+AES256s DH+AES256s ECDH+AES128sDH+AESs RSA+AESGCMsRSA+AESs!aNULLs!eNULLs!MD5(t SSLContextR(cB@sAeZd„Zd„Zddd„Zd„Zded„ZRS(cC@sO||_t|_tj|_d|_d|_d|_ d|_ d|_ dS(Ni( tprotocoltFalsetcheck_hostnametsslRt verify_modetNonetca_certstoptionstcertfiletkeyfiletciphers(tselftprotocol_version((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyt__init__vs       cC@s||_||_dS(N(R1R2(R4R1R2((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytload_cert_chains cC@s(||_|dk r$tdƒ‚ndS(Ns-CA directories not supported in older Pythons(R/R.R(R4tcafiletcapath((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytload_verify_locations…s  cC@s ||_dS(N(R3(R4t cipher_suite((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyt set_ciphers‹scC@setjdtƒi|jd6|jd6|jd6|jd6|jd6|d6}t|d|j |S( Ns2A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warningsR2R1R/t cert_reqst ssl_versiont server_sideR3( twarningstwarnRR2R1R/R-R)RR3(R4R%tserver_hostnameR?tkwargs((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyRŽs      N( t__name__t __module__R6R7R.R:R<R*R(((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyR(us   cC@s©|jddƒjƒ}t|ƒ}tj|ƒ}|sQtdj|ƒƒ‚nt|jƒƒ}||ƒj ƒ}t ||ƒs¥tdj|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. R'ts"Fingerprint of invalid length: {0}s6Fingerprints did not match. Expected "{0}", got "{1}".N( treplacetlowerR t HASHFUNC_MAPtgetRtformatRtencodetdigestt_const_compare_digestR(tcertt fingerprintt digest_lengththashfunctfingerprint_bytest cert_digest((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytassert_fingerprint£s   cC@s[|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 abbreviation. (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(R.RRtstrtgetattrR,(t candidatetres((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytresolve_cert_reqs¾s  cC@s[|dkrtSt|tƒrWtt|dƒ}|dkrSttd|ƒ}n|S|S(s like resolve_cert_reqs t PROTOCOL_N(R.RRRWRXR,(RYRZ((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytresolve_ssl_versionÕs  cC@s¶t|ptjƒ}|j|p$tƒ|dkr=tjn|}|dkrvd}|tO}|tO}|t O}n|j |O_ ||_ t |ddƒdk r²t |_n|S(sëAll arguments have the same meaning as ``ssl_wrap_socket``. By default, this function does a lot of the same work that ``ssl.create_default_context`` does on Python 3.4+. It: - Disables SSLv2, SSLv3, and compression - Sets a restricted set of server ciphers If you wish to enable SSLv3, you can do:: from urllib3.util import ssl_ context = ssl_.create_urllib3_context() context.options &= ~ssl_.OP_NO_SSLv3 You can do the same to enable compression (substituting ``COMPRESSION`` for ``SSLv3`` in the last line above). :param ssl_version: The desired protocol version to use. This will default to PROTOCOL_SSLv23 which will negotiate the highest protocol that both the server and your installation of OpenSSL support. :param cert_reqs: Whether to require the certificate verification. This defaults to ``ssl.CERT_REQUIRED``. :param options: Specific OpenSSL options. These default to ``ssl.OP_NO_SSLv2``, ``ssl.OP_NO_SSLv3``, ``ssl.OP_NO_COMPRESSION``. :param ciphers: Which cipher suites to allow the server to select. :returns: Constructed SSLContext object with specified options :rtype: SSLContext iR+N(R(R,RR<tDEFAULT_CIPHERSR.t CERT_REQUIREDRRRR0R-RXR*R+(R>R=R0R3tcontext((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytcreate_urllib3_contextås#      c C@sJ|} | dkr*t||d|ƒ} n|s6| r¥y| j|| ƒWqÍtk rk} t| ƒ‚qÍtk r¡} | jtjkr›t| ƒ‚n‚qÍXn(|dkrÍt| dƒrÍ| j ƒn|ræ| j ||ƒn|dk rÿt |ƒ st r=t r*|dk r*| j|d|ƒStjdtƒn| j|ƒS(sà All arguments except for server_hostname, ssl_context, and ca_cert_dir have the same meaning as they do when using :func:`ssl.wrap_socket`. :param server_hostname: When SNI is supported, the expected hostname of the certificate :param ssl_context: A pre-made :class:`SSLContext` object. If none is provided, one will be created using :func:`create_urllib3_context`. :param ciphers: A string of ciphers we wish the client to support. :param ca_cert_dir: A directory containing CA certificates in multiple separate files, as supported by OpenSSL's -CApath flag or the capath argument to SSLContext.load_verify_locations(). R3tload_default_certsRBs€An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warningsN(R.RaR:tIOErrorRtOSErrorterrnotENOENTthasattrRbR7t is_ipaddresstIS_SECURETRANSPORTRRR@RAR( tsockR2R1R=R/RBR>R3t ssl_contextt ca_cert_dirR`te((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytssl_wrap_socket#s2       cC@s¢tjr*t|tƒr*|jdƒ}ntjg}ttdƒrX|jtj ƒnxC|D];}yt ||ƒWntj t t fk r•q_XtSq_WtS(s­Detects whether the hostname given is an IP address. :param str hostname: Hostname to examine. :return: True if the hostname is an IP address, False otherwise. RtAF_INET6(R tPY3RRR R%tAF_INETRgtappendRoRterrort ValueErrorRdtTrueR*(thostnametfamiliestaf((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pyRhks  (ii(2t __future__RReR@thmacR%tbinasciiRRthashlibRRRt exceptionsRRRtpackagesR R.R(R*Rt IS_PYOPENSSLRiRIRRXRNR,RRRt ImportErrorRRRRgRR!tjoinR^tsystobjectRUR[R]RaRnRh(((s5/usr/lib/python2.7/site-packages/urllib3/util/ssl_.pytsŠ                     .   =   E