KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/doc/m2crypto-0.16/demo/ssl/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/m2crypto-0.16/demo/ssl/twistedsslclient.py
#!/usr/bin/python
"""
Demonstrates M2Crypto.SSL.TwistedProtocolWrapper

Copyright (c) 2005 Open Source Applications Foundation. All rights reserved.
"""

import twisted.internet.protocol as protocol
import twisted.protocols.basic as basic
import twisted.internet.reactor as reactor
import M2Crypto.SSL.TwistedProtocolWrapper as wrapper
import M2Crypto.SSL as SSL
        
class EchoClient(basic.LineReceiver):
    def connectionMade(self):
        self.sendLine('Hello World!')

    def lineReceived(self, line):
        print 'received: "%s"' % line
        self.transport.loseConnection()
        

class EchoClientFactory(protocol.ClientFactory):
    protocol = EchoClient

    def clientConnectionFailed(self, connector, reason):
        print 'connection failed'
        reactor.stop()

    def clientConnectionLost(self, connector, reason):
        print 'connection lost'
        reactor.stop()


class ContextFactory:
    def getContext(self):
        return SSL.Context()


if __name__ == '__main__':
    factory = EchoClientFactory()
    wrapper.connectSSL('localhost', 8000, factory, ContextFactory())
    reactor.run() # This will block until reactor.stop() is called

Anon7 - 2021