%PDF- %PDF-
Direktori : /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ |
Current File : //opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyo |
� �wMVc @ s d d l m Z m Z d d l m Z m Z d d l m Z yX d Z e Z d d l Z d d l m Z m Z m Z d d l m Z d d l m Z Wn e k r� n Xd � Z d � Z d � Z e d k r� d d d d d d d � Z n d d d d d d d � Z d S( i����( t hexlifyt unhexlify( t md5t sha1i ( t SSLErrorN( t wrap_sockett CERT_NONEt PROTOCOL_SSLv23( t SSLContext( t HAS_SNIc C s� i t d 6t d 6} | j d d � j � } t t | � d � \ } } | sY | | k rh t d � � n t | j � � } | | } | | � j � } | | k s� t d j t | � t | � � � � n d S( 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. i i t :t i s! Fingerprint is of invalid length.s6 Fingerprints did not match. Expected "{0}", got "{1}".N( R R t replacet lowert divmodt lenR R t encodet digestt formatR ( t certt fingerprintt hashfunc_mapt digest_lengtht restt fingerprint_bytest hashfunct cert_digest( ( s` /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyt assert_fingerprint s c C s[ | d k r t St | t � rW t t | d � } | d k rS t t d | � } 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. t CERT_N( t NoneR t isinstancet strt getattrt ssl( t candidatet res( ( s` /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyt resolve_cert_reqs8 s c C s[ | d k r t St | t � rW t t | d � } | d k rS t t d | � } n | S| S( s like resolve_cert_reqs t PROTOCOL_N( R R R R R R! ( R"