#NEWLINE# def test_getHandle( self ) : #NEWLINE# #INDENT# '\n        L{TLSMemoryBIOProtocol.getHandle} returns the L{OpenSSL.SSL.Connection}\n        instance it uses to actually implement TLS.\n\n        This may seem odd.  In fact, it is.  The L{OpenSSL.SSL.Connection} is\n        not actually the "system handle" here, nor even an object the reactor\n        knows about directly.  However, L{twisted.internet.ssl.Certificate}\'s\n        C{peerFromTransport} and C{hostFromTransport} methods depend on being\n        able to get an L{OpenSSL.SSL.Connection} object in order to work\n        properly.  Implementing L{ISystemHandle.getHandle} like this is the\n        easiest way for those APIs to be made to work.  If they are changed,\n        then it may make sense to get rid of this implementation of\n        L{ISystemHandle} and return the underlying socket instead.\n        ' #NEWLINE# factory = ClientFactory ( ) #NEWLINE# contextFactory = ClientContextFactory ( ) #NEWLINE# wrapperFactory = TLSMemoryBIOFactory ( contextFactory , True , factory ) #NEWLINE# proto = TLSMemoryBIOProtocol ( wrapperFactory , Protocol ( ) ) #NEWLINE# transport = StringTransport ( ) #NEWLINE# proto . makeConnection ( transport ) #NEWLINE# self . assertIsInstance ( proto . getHandle ( ) , ConnectionType )