
o
\c           @   s@   d  Z  d d l m Z d d l m Z d e f d     YZ d S(   s   Submodule containing the implementation for the FingerprintAdapter.

This file contains an implementation of a Transport Adapter that validates
the fingerprints of SSL certificates presented upon connection.
i(   t   HTTPAdapteri   (   t   poolmanagert   FingerprintAdapterc           B   s3   e  Z d  Z e j d g Z d   Z e d  Z RS(   s>  
    A HTTPS Adapter for Python Requests that verifies certificate fingerprints,
    instead of certificate hostnames.

    Example usage:

    .. code-block:: python

        import requests
        import ssl
        from requests_toolbelt.adapters.fingerprint import FingerprintAdapter

        twitter_fingerprint = '...'
        s = requests.Session()
        s.mount(
            'https://twitter.com',
            FingerprintAdapter(twitter_fingerprint)
        )

    The fingerprint should be provided as a hexadecimal string, optionally
    containing colons.
    t   fingerprintc         K   s#   | |  _  t t |   j |   d  S(   N(   R   t   superR   t   __init__(   t   selfR   t   kwargs(    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/requests_toolbelt/adapters/fingerprint.pyR   &   s    	c      	   C   s.   t  j d | d | d | d |  j  |  _  d  S(   Nt	   num_poolst   maxsizet   blockt   assert_fingerprint(   R   t   PoolManagerR   (   R   t   connectionsR	   R
   (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/requests_toolbelt/adapters/fingerprint.pyt   init_poolmanager+   s
    	(   t   __name__t
   __module__t   __doc__R    t	   __attrs__R   t   FalseR   (    (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/requests_toolbelt/adapters/fingerprint.pyR      s   	N(   R   t   requests.adaptersR    t   _compatR   R   (    (    (    s[   /data/av2000/b2b/venv/lib/python2.7/site-packages/requests_toolbelt/adapters/fingerprint.pyt   <module>   s   