mς
­fIc           @   s   d  k  Z  d k l Z d  k Z d  k Z e i d  o e e d  Z d   Z d   Z	 d   Z
 d   Z e d j o e   n d  S(	   N(   s   test_supportt   networkt   sslc          C   s   t  i d  d  k } t  i o	 d GHn t i   y t i d  Wn t j
 o n Xd GHt i d d  | i	 d  }  |  i   } |  i   d  S(   NR    s   test_basic ...i   s   didn't raise TypeErrors   this is a random stringf75.0s   https://sf.net(   t   test_supportt   requirest   urllibt   verboset   sockett   RAND_statust   RAND_egdt	   TypeErrort   RAND_addt   urlopent   ft   readt   buft   close(   R   R   R   (    (    t1   /mit/python/lib/python2.4/test/test_socket_ssl.pyt
   test_basic   s    	
	
c          C   sΈ   t  i d  t  i o	 d GHn d }  t i   } | i d  y | i |   Wn. t i j
 o t	 i
 d |  f IJd  Sn Xt i |  } | i d  | i d  | i   d  S(	   NR    s   test_timeout ...s	   gmail.orgiγ  f30.0sξ       WARNING:  an attempt to connect to %r timed out, in
    test_timeout.  That may be legitimate, but is not the outcome we hoped
    for.  If this message is seen often, test_timeout should be changed to
    use a more reliable address.i   (   s	   gmail.orgiγ  (   R   R   R   t   ADDRR   t   st
   settimeoutt   connectt   timeoutt   syst   stderrR   t   ssR   R   (   R   R   R   (    (    R   t   test_timeout"   s    
		c             s   t  i o	 d GHn y d  k   Wn t j
 o d  Sn Xd g     d   }   d   }   i |  f   t i	 d  |   d  S(   Ns   test_rude_shutdown ...iΞ&  c             s]   t  i  t  i t  i  }  t i |  d  d   d <|  i d  |  i   ~    i
   d  S(   Nt    i    i   (   R   t   AF_INETt   SOCK_STREAMR   R   t	   bind_portt   PORTt   listent   acceptt   threadt   exit(   R   (   R"   R   (    R   t   listenerL   s    
c             sk   t  i  t  i t  i  } | i d   d f  y t  i |  }  Wn t  i j
 o n Xt	 i
 d  d  S(   Nt	   localhosti    s&   connecting to closed SSL socket failed(   R   R   R   R   R   R   R   t   ssl_sockt   sslerrorR   t
   TestFailed(   R&   R   (   R   (    R   t	   connectorT   s    i   (
   R   R   R"   t   ImportErrorR   R$   R)   t   start_new_threadt   timet   sleep(   R$   R"   R)   R   (    (   R"   R   R   t   test_rude_shutdownA   s    
			c           C   s<   t  t d  p t i d   n t   t   t   d  S(   NR   s    socket module has no ssl support(   t   hasattrR   R   t   TestSkippedR.   R   R   (    (    (    R   t	   test_mainc   s
    t   __main__(   R   t   testR   R   R,   t   is_resource_enabledR/   t   skip_expectedR   R   R.   R1   t   __name__(	   R   R   R   R   R   R5   R,   R.   R1   (    (    R   t   ?   s   			 			"	