'Establish a connection using a protocol build by C{factory} and
immediately start TLS on it.  Return a L{Deferred} which fires with the
protocol instance.'

def connect(self, factory):

    class WrapperFactory(ServerFactory, ):
        def buildProtocol(wrapperSelf, addr):
            protocol = factory.buildProtocol(addr)
            def connectionMade(orig=protocol.connectionMade):
                protocol.transport.startTLS(self.contextFactory)
                orig()
            protocol.connectionMade = connectionMade
            return protocol
    return self.wrapped.connect(WrapperFactory())
