ó
ÐH/\c        
   @@  sS  d  Z  d d l m Z d d l Z e j Z d d l Z d d l m Z d d l	 m
 Z
 d d l	 m Z d d l	 m Z d d l	 m Z d d	 l m Z d d
 l m Z d d d d d d d d g Z e e e ƒ  d e d d g d f  ƒZ y e Wn) e k
 r d d d d d d f Z n Xe e Z d e k rGe j d ƒ n  e j Z d e f d „  ƒ  YZ e j e e e d „ Z  e! e e" e j e e e e e d  „	 Z# e  Z$ e# Z% d e f d! „  ƒ  YZ& e pÚe' e& d" ƒ røe( d# „  d$ „  ƒ e& _ n  e) d% ƒ Z* e) d& ƒ Z+ e) d' ƒ Z, e e e" e- e! e e. e. e d( „	 Z/ e! e d) „ Z0 d S(*   s®   SSL wrapper for socket objects on Python 2.7.9 and above.

For the documentation, refer to :mod:`ssl` module manual.

This module implements cooperative SSL socket wrappers.
i    (   t   absolute_importN(   t   socket(   t   timeout_default(   t   create_connection(   t   error(   t   timeout(   t   PYPY(   t   copy_globalst
   SSLContextt	   SSLSockett   wrap_sockett   get_server_certificatet   create_default_contextt   _create_unverified_contextt   _create_default_https_contextt   _create_stdlib_contextt   names_to_ignoreR   R   t   dunder_names_to_keept   recvt   recvfromt	   recv_intot   recvfrom_intot   sendt   sendtot
   namedtuplec           B@  s   e  Z e e e d d  „ Z RS(   c         C@  s+   t  d | d | d | d | d | d |  ƒ S(   Nt   sockt   server_sidet   do_handshake_on_connectt   suppress_ragged_eofst   server_hostnamet   _context(   R	   (   t   selfR   R   R   R   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR
   <   s
    N(   t   __name__t
   __module__t   Falset   Truet   NoneR
   (    (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   ;   s   c         C@  sB  t  |  t ƒ s t |  ƒ ‚ n  t t ƒ } | j t O_ | j t O_ | j t t	 d d ƒ O_ |  t
 j k r‡ t | _ t | _ np |  t
 j k r÷ | j t t	 d d ƒ O_ | j t t	 d d ƒ O_ | j t t	 d d ƒ O_ | j t ƒ n  | s	| s	| r| j | | | ƒ n | j t k r>| j |  ƒ n  | S(   sí   Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    t   OP_NO_COMPRESSIONi    t   OP_CIPHER_SERVER_PREFERENCEt   OP_SINGLE_DH_USEt   OP_SINGLE_ECDH_USE(   t
   isinstancet   _ASN1Objectt	   TypeErrorR   t   PROTOCOL_SSLv23t   optionst   OP_NO_SSLv2t   OP_NO_SSLv3t   getattrt   _sslt   Purposet   SERVER_AUTHt   CERT_REQUIREDt   verify_modeR#   t   check_hostnamet   CLIENT_AUTHt   set_cipherst   _RESTRICTED_SERVER_CIPHERSt   load_verify_locationst	   CERT_NONEt   load_default_certs(   t   purposet   cafilet   capatht   cadatat   context(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   G   s&    	c	   
      C@  sï   t  | t ƒ s t | ƒ ‚ n  t |  ƒ }	 |	 j t O_ |	 j t O_ | d k	 r` | |	 _ n  | |	 _	 | r… | r… t
 d ƒ ‚ n  | s‘ | r¤ |	 j | | ƒ n  | s¶ | s¶ | rÌ |	 j | | | ƒ n |	 j t k rë |	 j | ƒ n  |	 S(   s/  Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    s   certfile must be specifiedN(   R)   R*   R+   R   R-   R.   R/   R$   R5   R6   t
   ValueErrort   load_cert_chainR:   R;   R<   (
   t   protocolt	   cert_reqsR6   R=   t   certfilet   keyfileR>   R?   R@   RA   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   w   s"    	c           B@  s  e  Z d  Z d/ d/ d/ e e e d/ e e e	 d d/ e d/ d/ d/ d/ d „ Z
 e d „  ƒ Z e j d „  ƒ Z d „  Z d/ d „ Z d „  Z d d/ d	 „ Z d
 „  Z e d „ Z d „  Z e e d ƒ rÏ d „  Z n  d „  Z d „  Z d „  Z d e d „ Z d/ d „ Z d „  Z d d „ Z d d d „ Z  d/ d d „ Z! d d d „ Z" d/ d d „ Z# d „  Z$ d „  Z% d „  Z& d „  Z' d „  Z( e) ržd „  Z* d  „  Z+ n  d! „  Z, d" „  Z- d# „  Z. d$ „  Z/ d% „  Z0 d& „  Z1 d' „  Z2 d( „  Z3 d) d* d+ „ Z4 d, d- „ Z5 d. „  Z6 RS(0   s„   
    gevent `ssl.SSLSocket <https://docs.python.org/2/library/ssl.html#ssl-sockets>`_
    for Pythons >= 2.7.9 but less than 3.
    i    c         C@  s&  | r | |  _  n| r. | r. t d ƒ ‚ n  | rJ | rJ t d ƒ ‚ n  | r` | r` | } n  t | ƒ |  _  | |  j  _ | r” |  j  j | ƒ n  | r° |  j  j | | ƒ n  | rÉ |  j  j | ƒ n  | râ |  j  j | ƒ n  | |  _ | |  _	 | |  _
 | |  _ | |  _ | |  _ | j t t ƒ t k r?t d ƒ ‚ n  t ret j |  d | ƒ| j ƒ  n t j |  d | j ƒx3 t D]+ } y t |  | ƒ Wq‚t k
 r¬q‚Xq‚W| rÌ| rÌt d ƒ ‚ n  |  j  j rî| rît d ƒ ‚ n  | |  _ | |  _ | |  _ | |  _ |  j  | j! ƒ  ƒ y |  j" ƒ  Wn1 t# k
 rf} | j$ t$ j% k r]‚  n  t& } n Xt' } d |  _( t& |  _) d  |  _+ | |  _, | r"yb |  j  j- |  j | | d |  ƒ|  _+ | rø|  j! ƒ  } | d	 k rët d
 ƒ ‚ n  |  j. ƒ  n  Wq"t# k
 r} |  j/ ƒ  | ‚ q"Xn  d  S(   Ns5   certfile must be specified for server-side operationss   certfile must be specifieds!   only stream sockets are supportedt   _socks4   server_hostname can only be specified in client modes'   check_hostname requires server_hostnamei    t   ssl_sockg        sH   do_handshake_on_connect should not be specified for non-blocking sockets(0   R   RB   R   R5   R:   RC   t   set_npn_protocolsR8   RG   RF   RE   t   ssl_versiont   ca_certst   cipherst
   getsockoptt
   SOL_SOCKETt   SO_TYPEt   SOCK_STREAMt   NotImplementedErrorR   R   t   __init__t   _dropRH   t   _delegate_methodst   delattrt   AttributeErrorR6   R   R   R   R   t
   settimeoutt
   gettimeoutt   getpeernamet   socket_errort   errnot   ENOTCONNR"   R#   t   _makefile_refst   _closedR$   t   _sslobjt
   _connectedt   _wrap_sockett   do_handshaket   close(   R   R   RG   RF   R   RE   RK   RL   R   t   familyt   typet   protot   filenoR   t   npn_protocolsRM   R   R   t   attrt   et	   connectedR   t   x(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRS   ­   s†    
											
				
c         C@  s   |  j  S(   N(   R   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRA     s    c         C@  s   | |  _  | |  j _ d  S(   N(   R   R`   RA   (   R   t   ctx(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRA     s    	c         C@  s   t  d |  j j ƒ ‚ d  S(   Ns   Can't dup() %s instances(   RR   t	   __class__R    (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   dup  s    c         C@  s   d  S(   N(    (   R   t   msg(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   _checkClosed  s    c         C@  s   |  j  s |  j ƒ  n  d  S(   N(   Ra   RZ   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   _check_connected"  s    	i   c         C@  sl  |  j  ƒ  x[|  j s% t d ƒ ‚ n  | d k rE | d k rA d Sd S| d k  rl | d k rl t d ƒ ‚ n  y9 | d k	 rŽ |  j j | | ƒ S|  j j | p  d ƒ SWq t k
 rã |  j d k rÊ ‚  n  |  j |  j d t	 ƒq t
 k
 r|  j d k r‚  n  |  j |  j d t	 ƒq t k
 rc} | j d t k r]|  j r]| d k	 rYd Sd S‚  q Xq Wd S(	   sO   Read up to LEN bytes and return them.
        Return zero-length string on EOF.s'   Read on closed or unwrapped SSL socket.i    t    s   Negative read lengthi   g        t   timeout_excN(   Rr   R`   RB   R$   t   readt   SSLWantReadErrorR   t   _waitt   _read_eventt   _SSLErrorReadTimeoutt   SSLWantWriteErrort   _write_eventt   SSLErrort   argst   SSL_ERROR_EOFR   (   R   t   lent   buffert   ex(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRv   *  s4    
	c         C@  sÜ   |  j  ƒ  xË |  j s% t d ƒ ‚ n  y |  j j | ƒ SWq t k
 rÓ } | j d t k rŒ |  j d k rs ‚  n  |  j |  j	 d t
 ƒqÔ | j d t k rÍ |  j d k r´ ‚  n  |  j |  j d t
 ƒqÔ ‚  q Xq Wd S(   sh   Write DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.s(   Write on closed or unwrapped SSL socket.i    g        Ru   N(   Rr   R`   RB   t   writeR}   R~   t   SSL_ERROR_WANT_READR   Rx   Ry   t   _SSLErrorWriteTimeoutt   SSL_ERROR_WANT_WRITER|   (   R   t   dataR‚   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRƒ   K  s     
	c         C@  s$   |  j  ƒ  |  j ƒ  |  j j | ƒ S(   sá   Returns a formatted version of the data in the
        certificate provided by the other end of the SSL channel.
        Return None if no certificate was provided, {} if a
        certificate was provided, but not validated.(   Rr   Rs   R`   t   peer_certificate(   R   t   binary_form(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   getpeercertb  s    

c         C@  s/   |  j  ƒ  |  j s t j r" d  S|  j j ƒ  S(   N(   Rr   R`   R1   t   HAS_NPNR$   t   selected_npn_protocol(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRŒ   l  s    
t   HAS_ALPNc         C@  s/   |  j  ƒ  |  j s t j r" d  S|  j j ƒ  S(   N(   Rr   R`   R1   R   R$   t   selected_alpn_protocol(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRŽ   t  s    
c         C@  s$   |  j  ƒ  |  j s d  S|  j j ƒ  S(   N(   Rr   R`   R$   t   cipher(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   z  s    
	c         C@  s$   |  j  ƒ  |  j s d  S|  j j ƒ  S(   N(   Rr   R`   R$   t   compression(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   €  s    
	c         C@  s,   | d k r( t  d | |  j f ƒ ‚ n  d  S(   Ni    s/   non-zero flags not allowed in calls to %s on %s(   RB   Ro   (   R   t   metht   flags(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   __check_flags†  s    c         C@  sà   |  j  ƒ  |  j d | ƒ | t k r2 |  j } n  |  j sQ t j |  | | | ƒ Sxˆ t rÛ y |  j j | ƒ SWqT t	 k
 r¤ |  j d k r‘ d S|  j
 |  j ƒ qT t k
 r× |  j d k rÄ d S|  j
 |  j ƒ qT XqT Wd  S(   NR   g        i    (   Rr   t   _SSLSocket__check_flagsR   R   R`   R   R   R#   Rƒ   Rw   Rx   Ry   R{   R|   (   R   R‡   R’   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   Œ  s"    
		c         C@  sb   |  j  ƒ  |  j r) t d |  j ƒ ‚ n5 | d  k rH t j |  | | ƒ St j |  | | | ƒ Sd  S(   Ns%   sendto not allowed on instances of %s(   Rr   R`   RB   Ro   R$   R   R   (   R   R‡   t   flags_or_addrt   addr(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   ¢  s    
	c         O@  s   t  d |  j ƒ ‚ d  S(   Ns&   sendmsg not allowed on instances of %s(   RR   Ro   (   R   R~   t   kwargs(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   sendmsg¬  s    c         C@  su   |  j  ƒ  |  j d | ƒ y t j |  | ƒ Wn@ t k
 rp } |  j d k r^ t d ƒ ‚ n  t | j Œ  ‚ n Xd  S(   Nt   sendallg        s&   The operation did not complete (write)(	   Rr   R”   R   R™   t   _socket_timeoutR   R{   R}   R~   (   R   R‡   R’   R‚   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR™   ²  s    
c         C@  se   |  j  ƒ  |  j rR | d k r5 t d |  j ƒ ‚ n  | d k rE d S|  j | ƒ St j |  | | ƒ S(   Ni    s3   non-zero flags not allowed in calls to recv() on %sRt   (   Rr   R`   RB   Ro   Rv   R   R   (   R   t   buflenR’   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   À  s    
	c         C@  s—   |  j  ƒ  | d  k	 r1 | d  k r1 t | ƒ } n | d  k rF d } n  |  j r | d k rq t d |  j ƒ ‚ n  |  j | | ƒ St j |  | | | ƒ S(   Ni   i    s8   non-zero flags not allowed in calls to recv_into() on %s(	   Rr   R$   R€   R`   RB   Ro   Rv   R   R   (   R   R   t   nbytesR’   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   Ì  s    
		c         C@  s<   |  j  ƒ  |  j r) t d |  j ƒ ‚ n  t j |  | | ƒ S(   Ns'   recvfrom not allowed on instances of %s(   Rr   R`   RB   Ro   R   R   (   R   R›   R’   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   Ü  s
    
	c         C@  sC   |  j  ƒ  |  j r) t d |  j ƒ ‚ n t j |  | | | ƒ Sd  S(   Ns,   recvfrom_into not allowed on instances of %s(   Rr   R`   RB   Ro   R   R   (   R   R   Rœ   R’   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   ã  s
    
	c         O@  s   t  d |  j ƒ ‚ d  S(   Ns&   recvmsg not allowed on instances of %s(   RR   Ro   (   R   R~   R—   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   recvmsgë  s    c         O@  s   t  d |  j ƒ ‚ d  S(   Ns+   recvmsg_into not allowed on instances of %s(   RR   Ro   (   R   R~   R—   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   recvmsg_intoï  s    c         C@  s$   |  j  ƒ  |  j r  |  j j ƒ  Sd S(   Ni    (   Rr   R`   t   pending(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRŸ   ó  s    
	c         C@  s'   |  j  ƒ  d  |  _ t j |  | ƒ d  S(   N(   Rr   R$   R`   R   t   shutdown(   R   t   how(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR    ù  s    
	c         C@  s;   |  j  d k  r( d  |  _ t j |  ƒ n |  j  d 8_  d  S(   Ni   (   R^   R$   R`   R   Rd   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRd   þ  s    	c         C@  s   |  j  d 7_  d  S(   Ni   (   R^   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   _reuse  s    c         C@  s/   |  j  d k  r |  j ƒ  n |  j  d 8_  d  S(   Ni   (   R^   Rd   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRT   
  s    c         C@  sñ   xê t  rì y |  j j ƒ  SWq t k
 rè } | j d t k rL |  j rL d S| j d t k r— |  j d k rt ‚  n  t	 j
 ƒ  |  j |  j d t ƒqé | j d t k râ |  j d k r¿ ‚  n  t	 j
 ƒ  |  j |  j d t ƒqé ‚  q Xq Wd  S(   Ni    Rt   g        Ru   (   R#   R`   R    R}   R~   R   R   R„   R   t   syst	   exc_clearRx   Ry   Rz   R†   R|   R…   (   R   R‚   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   _sslobj_shutdown  s"    	

c         C@  sD   |  j  s" t d t |  ƒ ƒ ‚ n  |  j ƒ  } d  |  _  t d | ƒ S(   Ns   No SSL wrapper around RH   (   R`   RB   t   strR¥   R$   R   (   R   t   s(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   unwrap$  s
    		c         C@  s   d  |  _ t j |  ƒ d  S(   N(   R$   R`   R   t   _real_close(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR©   /  s    	c         C@  sä   |  j  ƒ  x– t r¢ y |  j j ƒ  PWq t k
 rc |  j d k rJ ‚  n  |  j |  j d t ƒq t	 k
 rž |  j d k r… ‚  n  |  j |  j
 d t ƒq Xq W|  j j rà |  j sÇ t d ƒ ‚ n  t |  j ƒ  |  j ƒ n  d S(   s   Perform a TLS/SSL handshake.g        Ru   s-   check_hostname needs server_hostname argumentN(   Rs   R#   R`   Rc   Rw   R   Rx   Ry   t   _SSLErrorHandshakeTimeoutR{   R|   R   R6   R   RB   t   match_hostnameRŠ   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRc   3  s"    
		c         C@  sÜ   |  j  r t d ƒ ‚ n  |  j r0 t d ƒ ‚ n  |  j j |  j t |  j d |  ƒ|  _ ya | ru t	 j
 |  | ƒ } n d  } t	 j |  | ƒ | s³ t |  _ |  j r³ |  j ƒ  q³ n  | SWn t k
 r× d  |  _ ‚  n Xd  S(   Ns!   can't connect in server-side modes/   attempt to connect already-connected SSLSocket!RI   (   R   RB   Ra   R   Rb   RH   R"   R   R`   R   t
   connect_exR$   t   connectR#   R   Rc   R[   (   R   R–   R¬   t   rc(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   _real_connectI  s$    		'			c         C@  s   |  j  | t ƒ d S(   sQ   Connects to remote ADDR, and then wraps the connection in
        an SSL channel.N(   R¯   R"   (   R   R–   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR­   `  s    c         C@  s   |  j  | t ƒ S(   sQ   Connects to remote ADDR, and then wraps the connection in
        an SSL channel.(   R¯   R#   (   R   R–   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR¬   e  s    c         C@  sS   t  j |  ƒ \ } } | j ƒ  |  j j | d |  j d |  j d t ƒ} | | f S(   s¿   Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.R   R   R   (   R   t   acceptt   _drop_eventsR   R
   R   R   R#   (   R   t   newsockR–   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR°   j  s    
			t   riÿÿÿÿc         C@  s.   t  s |  j d 7_ n  t |  | | d t ƒS(   s   Make and return a file-like object that
        works with the SSL connection.  Just use the code
        from the socket module.i   Rd   (   R   R^   t   _fileobjectR#   (   R   t   modet   bufsize(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   makefilew  s    s
   tls-uniquec         C@  s_   | t  k r t d ƒ ‚ n  | d k r? t d j | ƒ ƒ ‚ n  |  j d k rR d S|  j j ƒ  S(   sä   Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).
        s    Unsupported channel binding types
   tls-uniques(   {0} channel binding type not implementedN(   t   CHANNEL_BINDING_TYPESRB   RR   t   formatR`   R$   t   tls_unique_cb(   R   t   cb_type(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   get_channel_binding‚  s    c         C@  s    |  j  d k r d S|  j  j ƒ  S(   s—   
        Return a string identifying the protocol version used by the
        current SSL channel, or None if there is no established channel.
        N(   R`   R$   t   version(   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR½   ‘  s    N(7   R    R!   t   __doc__R$   R"   R;   R,   R#   t   AF_INETRQ   RS   t   propertyRA   t   setterRp   Rr   Rs   Rv   Rƒ   RŠ   RŒ   t   hasattrR1   RŽ   R   R   R”   R   R   R   R˜   R™   R   R   R   R   R   Rž   RŸ   R    Rd   R   R¢   RT   R¥   R¨   R©   Rc   R¯   R­   R¬   R°   R·   R¼   R½   (    (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR	   §   sd   		]		!	
				
															R   c         C@  s
   |  j  ƒ  S(   N(   RY   (   R   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   <lambda>¢  s    c         C@  s   |  j  | ƒ S(   N(   RX   (   R   t   value(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyRÃ   £  s    s   The read operation timed outs   The write operation timed outs!   The handshake operation timed outc
   
      C@  sC   t  d |  d | d | d | d | d | d | d | d	 | d
 |	 ƒ 
S(   NR   RG   RF   R   RE   RK   RL   R   R   RM   (   R	   (
   R   RG   RF   R   RE   RK   RL   R   R   RM   (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR
   «  s    c   	   
   C@  s‘   |  \ } } | d k	 r! t } n t } t | d | d | ƒ} t t |  ƒ ƒ 4 } t | j | ƒ ƒ  } | j t ƒ } Wd QXWd QXt	 | ƒ S(   s÷   Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.RE   R>   N(
   R$   R4   R;   R   t   closingR   R
   RŠ   R#   t   DER_cert_to_PEM_cert(	   R–   RK   RL   t   _RE   RA   R   t   sslsockt   dercert(    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyR   ¹  s    			(1   R¾   t
   __future__R    t   sslt   __ssl__R1   R\   t   gevent._socket2R   t   gevent.socketR   R   R   R[   R   Rš   t   gevent._compatR   t   gevent._utilR   t   __implements__t   globalst   __imports__RU   t	   NameErrort   __all__t   removeR   t   orig_SSLContextR2   R3   R$   R   R,   R"   R   R   R   R	   RÂ   RÀ   R}   Rz   R…   Rª   R;   R#   R
   R   (    (    (    s0   lib/python2.7/site-packages/gevent/_sslgte279.pyt   <module>   sl   			
		/	'ÿ ô		