ó
[³XMc           @   s“  d  Z  y d d l m Z m Z Wn e k
 r9 d Z nY Xd d l m Z d d l m	 Z	 m
 Z
 m Z m Z d d l m Z m Z d d l m Z d d l m Z d d	 l m Z m Z d d
 l m Z d d l m Z m Z d d l m Z m Z m Z d d l m  Z  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 „  ƒ  YZ* d e f d „  ƒ  YZ+ d e# f d „  ƒ  YZ, d S(   s%   
Tests for L{twisted.protocols.tls}.
iÿÿÿÿ(   t   TLSMemoryBIOProtocolt   TLSMemoryBIOFactorys9   pyOpenSSL 0.10 or newer required for twisted.protocol.tls(   t   X509Type(   t   TLSv1_METHODt   Errort   Contextt   ConnectionType(   t   ClientContextFactoryt   PrivateCertificate(   t   DefaultOpenSSLContextFactory(   t   FilePath(   t   ISystemHandlet   ISSLTransport(   t   ConnectionDone(   t   Deferredt   gatherResults(   t   Protocolt   ClientFactoryt   ServerFactory(   t   loopbackAsynct   collapsingPumpPolicy(   t   TestCase(   t   ConnectionLostNotifyingProtocol(   t   certPath(   t   StringTransportt   HandshakeCallbackContextFactoryc           B   sD   e  Z d  Z d Z d „  Z d „  Z e e ƒ Z d „  Z d „  Z RS(   s   
    L{HandshakeCallbackContextFactory} is a factory for SSL contexts which
    allows applications to get notification when the SSL handshake completes.

    @ivar _finished: A L{Deferred} which will be called back when the handshake
        is done.
    i    c         C   s   t  ƒ  |  _ d  S(   N(   R   t	   _finished(   t   self(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   __init__-   s    c         C   s   |  ƒ  } | | j  f S(   sÍ   
        Create a new L{HandshakeCallbackContextFactory} and return a two-tuple
        of it and a L{Deferred} which will fire when a connection created with
        it completes a TLS handshake.
        (   R   (   t   clst   contextFactory(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   factoryAndDeferred1   s    	c         C   s$   | |  j  @r  |  j j d ƒ n  d S(   s  
        This is the "info callback" on the context.  It will be called
        periodically by pyOpenSSL with information about the state of a
        connection.  When it indicates the handshake is complete, it will fire
        C{self._finished}.
        N(   t   SSL_CB_HANDSHAKE_DONER   t   callbackt   None(   R   t
   connectiont   wheret   ret(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   _info<   s    c         C   s    t  t ƒ } | j |  j ƒ | S(   sp   
        Create and return an SSL context configured to use L{self._info} as the
        info callback.
        (   R   R   t   set_info_callbackR&   (   R   t   context(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt
   getContextG   s    (	   t   __name__t
   __module__t   __doc__R    R   R   t   classmethodR&   R)   (    (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR   !   s   			t   AccumulatingProtocolc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s$  
    A protocol which collects the bytes it receives and closes its connection
    after receiving a certain minimum of data.

    @ivar howMany: The number of bytes of data to wait for before closing the connection.
    @ivar receiving: A C{list} of C{str} of the bytes received so far.
    c         C   s   | |  _  d  S(   N(   t   howMany(   R   R/   (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR   Z   s    c         C   s   g  |  _  d  S(   N(   t   received(   R   (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   connectionMade^   s    c         C   sE   |  j  j | ƒ t t t |  j  ƒ ƒ |  j k rA |  j j ƒ  n  d  S(   N(   R0   t   appendt   sumt   mapt   lenR/   t	   transportt   loseConnection(   R   t   bytes(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   dataReceivedb   s    !(   R*   R+   R,   R   R1   R9   (    (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR.   R   s   		t   TLSMemoryBIOTestsc           B   sƒ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   se   
    Tests for the implementation of L{ISSLTransport} which runs over another
    L{ITransport}.
    c         C   s?   t  d d ƒ } |  j t j | ƒ ƒ |  j t j | ƒ ƒ d S(   sj   
        L{TLSMemoryBIOProtocol} instances provide L{ISSLTransport} and
        L{ISystemHandle}.
        N(   R    R"   t
   assertTrueR   t
   providedByR   (   R   t   proto(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_interfacesn   s    c         C   sf   t  ƒ  } t ƒ  } t | t | ƒ } t | t ƒ  ƒ } t ƒ  } | j | ƒ |  j | j	 ƒ  t
 ƒ d S(   s/  
        L{TLSMemoryBIOProtocol.getHandle} returns the L{OpenSSL.SSL.Connection}
        instance it uses to actually implement TLS.

        This may seem odd.  In fact, it is.  The L{OpenSSL.SSL.Connection} is
        not actually the "system handle" here, nor even an object the reactor
        knows about directly.  However, L{twisted.internet.ssl.Certificate}'s
        C{peerFromTransport} and C{hostFromTransport} methods depend on being
        able to get an L{OpenSSL.SSL.Connection} object in order to work
        properly.  Implementing L{ISystemHandle.getHandle} like this is the
        easiest way for those APIs to be made to work.  If they are changed,
        then it may make sense to get rid of this implementation of
        L{ISystemHandle} and return the underlying socket instead.
        N(   R   R   R   t   TrueR    R   R   t   makeConnectiont   assertIsInstancet	   getHandleR   (   R   t   factoryR   t   wrapperFactoryR=   R6   (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_getHandlex   s    			c            sŽ   t  ƒ  ‰  t ƒ  } ‡  f d †  | _ t ƒ  } t | t | ƒ } | j d ƒ } t ƒ  } | j	 | ƒ |  j
 ˆ  j d ƒ |  j
 ˆ  j | ƒ d S(   s…   
        When L{TLSMemoryBIOProtocol} is connected to a transport, it connects
        the protocol it wraps to a transport.
        c              s   ˆ  S(   N(    (    (   t   clientProtocol(    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   <lambda>—   s    N(   R   R   t   protocolR   R   R?   t   buildProtocolR"   R   R@   t   assertNotIdenticalR6   (   R   t   clientFactoryR   RD   t   sslProtocolR6   (    (   RF   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_makeConnection   s    				c   
      C   sš   t  ƒ  } t | _ t j ƒ  \ } } t | t | ƒ } | j d ƒ } t	 ƒ  } t | _ t
 t t ƒ } t | t | ƒ } | j d ƒ } t | | ƒ }	 | S(   sr   
        The TLS handshake is performed when L{TLSMemoryBIOProtocol} is
        connected to a transport.
        N(   R   R   RH   R   R   R   R?   RI   R"   R   R	   R   t   FalseR   (
   R   RK   t   clientContextFactoryt   handshakeDeferredRD   t   sslClientProtocolt   serverFactoryt   serverContextFactoryt   sslServerProtocolt   connectionDeferred(    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_handshake¥   s    				c            s  t  ƒ  ‰  t ƒ  } ‡  f d †  | _ t ƒ  } t | t | ƒ } | j d ƒ } t  ƒ  ‰ t ƒ  } ‡ f d †  | _ t	 t
 ƒ j ƒ  } t j | ƒ } | j | ƒ } t | t | ƒ } | j d ƒ }	 t |	 | ƒ }
 d „  } ˆ  j | ƒ ˆ j | ƒ t ˆ  ˆ |
 g ƒ S(   s×   
        L{TLSMemoryBIOProtocol} reports errors in the handshake process to the
        application-level protocol object using its C{connectionLost} method
        and disconnects the underlying transport.
        c              s
   t  ˆ  ƒ S(   N(   R   (    (   t   clientConnectionLost(    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   Ë   s   c              s
   t  ˆ  ƒ S(   N(   R   (    (   t   serverConnectionLost(    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   Ö   s   c         S   s   |  j  j t ƒ d  S(   N(   t   lostConnectionReasont   trapR   (   RH   (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   cbConnectionLostä   s    N(   R   R   RH   R   R   R?   RI   R"   R   R
   R   t
   getContentR   t   loadPEMt   optionsRN   R   t   addCallbackR   (   R   RK   RO   RD   RQ   RR   t   certificateDatat   certificateRS   RT   RU   R[   (    (   RW   RX   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_handshakeFailureÂ   s.    						c   
         s¹   t  ƒ  } t | _ t j ƒ  \ } } t | t | ƒ } | j d ƒ ‰ t	 ƒ  } t | _ t
 t t ƒ } t | t | ƒ } | j d ƒ } t | ˆ ƒ } ‡  ‡ f d †  }	 | j |	 ƒ | S(   s    
        L{TLSMemoryBIOFactory.getPeerCertificate} returns the
        L{OpenSSL.crypto.X509Type} instance representing the peer's
        certificate.
        c            s9   ˆ j  ƒ  } ˆ  j | t ƒ ˆ  j | j d ƒ d ƒ d  S(   Nt   md5s/   9B:A4:AB:43:10:BE:82:AE:94:3E:6B:91:F2:F3:40:E8(   t   getPeerCertificateRA   R   t   assertEqualst   digest(   t   ignoredt   cert(   R   RQ   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   cbHandshook  s
    N(   R   R   RH   R   R   R   R?   RI   R"   R   R	   R   RN   R   R_   (
   R   RK   RO   RP   RD   RR   RS   RT   RU   Ri   (    (   R   RQ   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_getPeerCertificateô   s"    				c            s  d ‰ t  ƒ  ‰ t ƒ  } ‡ f d †  | _ t j ƒ  \ } } t | t | ƒ } | j d ƒ } t	 t
 ˆ ƒ ƒ ‰ t ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ } t | | ƒ ‰  ‡  ‡ ‡ f d †  }	 | j |	 ƒ ‡ ‡ ‡ f d †  }
 | j |
 ƒ | S(   sÉ   
        Bytes written to L{TLSMemoryBIOProtocol} before the handshake is
        complete are received by the protocol on the other side of the
        connection once the handshake succeeds.
        s
   some bytesc              s   ˆ  S(   N(    (    (   RF   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   %  s    c              s   ˆ  S(   N(    (    (   t   serverProtocol(    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   /  s    c            s   ˆ j  j ˆ ƒ ˆ  S(   N(   R6   t   write(   Rg   (   RU   R8   RF   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRi   9  s    c            s    ˆ  j  d j ˆ j ƒ ˆ ƒ d  S(   Nt    (   Re   t   joinR0   (   Rg   (   R   Rk   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   cbDisconnectedB  s    N(   R   R   RH   R   R   R   R?   RI   R"   R.   R5   R   R	   R   RN   R   R_   (   R   RK   RO   RP   RD   RQ   RR   RS   RT   Ri   Ro   (    (   RU   R   RF   Rk   R8   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_writeAfterHandshake  s*    			c            sù   d ‰ d t  f ‡ f d †  ƒ  Y} t ƒ  } | | _ t j ƒ  \ } } t | t | ƒ } | j d ƒ } t	 t
 ˆ ƒ ƒ ‰ t ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ }	 t |	 | ƒ }
 ‡  ‡ ‡ f d †  } |
 j | ƒ |
 S(   sÉ   
        Bytes written to L{TLSMemoryBIOProtocol} before the handshake is
        complete are received by the protocol on the other side of the
        connection once the handshake succeeds.
        s
   some bytest   SimpleSendingProtocolc              s   e  Z ‡  f d  †  Z RS(   c            s   |  j  j ˆ  ƒ d  S(   N(   R6   Rl   (   R   (   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR1   R  s    (   R*   R+   R1   (    (   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRq   Q  s   c              s   ˆ  S(   N(    (    (   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   `  s    c            s    ˆ  j  d j ˆ j ƒ ˆ ƒ d  S(   NRm   (   Re   Rn   R0   (   Rg   (   R   Rk   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   cbConnectionDonek  s    N(   R   R   RH   R   R   R   R?   RI   R"   R.   R5   R   R	   R   RN   R   R_   (   R   Rq   RK   RO   RP   RD   RQ   RR   RS   RT   RU   Rr   (    (   R   Rk   R8   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_writeBeforeHandshakeI  s&    			c            sð   d ‰ d t  f ‡ f d †  ƒ  Y} t ƒ  } | | _ t ƒ  } t | t | ƒ } | j d ƒ } t t	 ˆ ƒ ƒ ‰ t
 ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ } t | | ƒ }	 ‡  ‡ ‡ f d †  }
 |	 j |
 ƒ |	 S(   sš   
        Bytes written to L{TLSMemoryBIOProtocol} with C{writeSequence} are
        received by the protocol on the other side of the connection.
        s
   some bytesRq   c              s   e  Z ‡  f d  †  Z RS(   c            s   |  j  j t ˆ  ƒ ƒ d  S(   N(   R6   t   writeSequencet   list(   R   (   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR1   x  s    (   R*   R+   R1   (    (   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRq   w  s   c              s   ˆ  S(   N(    (    (   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   …  s    c            s    ˆ  j  d j ˆ j ƒ ˆ ƒ d  S(   NRm   (   Re   Rn   R0   (   Rg   (   R   Rk   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRr     s    N(   R   R   RH   R   R   R?   RI   R"   R.   R5   R   R	   R   RN   R   R_   (   R   Rq   RK   RO   RD   RQ   RR   RS   RT   RU   Rr   (    (   R   Rk   R8   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_writeSequenceq  s&    				c            s  g  t  d ƒ D] } t | ƒ ^ q ‰ d t f ‡ f d †  ƒ  Y} t ƒ  } | | _ t ƒ  } t | t | ƒ } | j d ƒ } t
 t t t ˆ ƒ ƒ ƒ ‰ t ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ }	 t |	 | t ƒ }
 ‡  ‡ ‡ f d †  } |
 j | ƒ |
 S(   sá   
        If multiple separate TLS messages are received in a single chunk from
        the underlying transport, all of the application bytes from each
        message are delivered to the application-level protocol.
        i
   Rq   c              s   e  Z ‡  f d  †  Z RS(   c            s%   x ˆ  D] } |  j  j | ƒ q Wd  S(   N(   R6   Rl   (   R   t   b(   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR1   ž  s    (   R*   R+   R1   (    (   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRq     s   c              s   ˆ  S(   N(    (    (   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   ¬  s    c            s)   ˆ  j  d j ˆ j ƒ d j ˆ ƒ ƒ d  S(   NRm   (   Re   Rn   R0   (   Rg   (   R   Rk   R8   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRr   ·  s    N(   t   ranget   strR   R   RH   R   R   R?   RI   R"   R.   R3   R4   R5   R   R	   R   RN   R   R   R_   (   R   t   iRq   RK   RO   RD   RQ   RR   RS   RT   RU   Rr   (    (   R   Rk   R8   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_multipleWrites–  s&    %				c            s   d ‰ d ‰ d t  f ‡ ‡ f d †  ƒ  Y} t ƒ  } | | _ t ƒ  } t | t | ƒ } | j d ƒ } t t	 ˆ ƒ ˆ ƒ ‰ t
 ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ } t | | ƒ }	 ‡  ‡ ‡ ‡ f d †  }
 |	 j |
 ƒ |	 S(   s¸   
        If a very long string is passed to L{TLSMemoryBIOProtocol.write}, any
        trailing part of it which cannot be send immediately is buffered and
        sent later.
        s
   some bytesi    Rq   c              s   e  Z ‡  ‡ f d  †  Z RS(   c            s   |  j  j ˆ  ˆ ƒ d  S(   N(   R6   Rl   (   R   (   R8   t   factor(    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR1   Æ  s    (   R*   R+   R1   (    (   R8   R|   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRq   Å  s   c              s   ˆ  S(   N(    (    (   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   Ó  s    c            s$   ˆ  j  d j ˆ j ƒ ˆ ˆ ƒ d  S(   NRm   (   Re   Rn   R0   (   Rg   (   R   Rk   R8   R|   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRr   Þ  s    N(   R   R   RH   R   R   R?   RI   R"   R.   R5   R   R	   R   RN   R   R_   (   R   Rq   RK   RO   RD   RQ   RR   RS   RT   RU   Rr   (    (   R   R|   Rk   R8   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_hugeWrite½  s(    				c            s   t  ƒ  ‰  t ƒ  } ‡  f d †  | _ t ƒ  } t | t | ƒ } | j d ƒ } t ƒ  } t	 | | ƒ } | j
 j ƒ  d „  } ˆ  j | ƒ ˆ  S(   s~   
        If a L{TLSMemoryBIOProtocol} loses its connection unexpectedly, this is
        reported to the application.
        c              s
   t  ˆ  ƒ S(   N(   R   (    (   RW   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG   ì  s   c         S   s   |  j  j t ƒ d  S(   N(   RY   RZ   R   (   RF   (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRo   ý  s    N(   R   R   RH   R   R   R?   RI   R"   R   R   R6   R7   R_   (   R   RK   RO   RD   RQ   Rk   RU   Ro   (    (   RW   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   test_disorderlyShutdownä  s    					c            sü   t  ƒ  ‰  t ƒ  } ‡  f d †  | _ t j ƒ  \ } } t | t | ƒ } | j d ƒ } t	 ƒ  ‰ t
 ƒ  } ‡ f d †  | _ t t t ƒ } t | t | ƒ } | j d ƒ } t | | ƒ }	 ‡ ‡  f d †  }
 | j |
 ƒ ‡ ‡ f d †  } | j | ƒ | S(   s‚   
        L{TLSMemoryBIOProtocol.loseConnection} sends a TLS close alert and
        shuts down the underlying connection.
        c              s
   t  ˆ  ƒ S(   N(   R   (    (   RW   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG     s   c              s   ˆ  S(   N(    (    (   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRG     s    c            s   ˆ  j  j ƒ  ˆ S(   N(   R6   R7   (   Rg   (   Rk   RW   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   cbHandshake   s    c            s@   |  j  j t ƒ ˆ  j ˆ j j j ƒ ˆ  j |  j j j ƒ d  S(   N(   RY   RZ   R   R;   R6   t   qt
   disconnect(   RF   (   R   Rk   (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyRr   )  s    N(   R   R   RH   R   R   R   R?   RI   R"   R   R   R	   R   RN   R   R_   (   R   RK   RO   RP   RD   RQ   RR   RS   RT   RU   R   Rr   (    (   RW   R   Rk   sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt!   test_loseConnectionAfterHandshake  s(    				(   R*   R+   R,   R>   RE   RM   RV   Rb   Rj   Rp   Rs   Rv   R{   R}   R~   R‚   (    (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyR:   i   s   	
				2	'	.	(	%	'	'	N(    (-   R,   t   twisted.protocols.tlsR    R   t   ImportErrort   skipt   OpenSSL.cryptoR   t   OpenSSL.SSLR   R   R   R   t   twisted.internet.sslR   R   R	   t   twisted.python.filepathR
   t   twisted.internet.interfacesR   R   t   twisted.internet.errorR   t   twisted.internet.deferR   R   t   twisted.internet.protocolR   R   R   t   twisted.protocols.loopbackR   R   t   twisted.trial.unittestR   t   twisted.test.test_tcpR   t   twisted.test.test_sslR   t   twisted.test.proto_helpersR   R   R.   R:   (    (    (    sC   /usr/lib/python2.7/dist-packages/twisted/protocols/test/test_tls.pyt   <module>   s*   
"1