[PYTHON-CRYPTO] HTTPSConnection question

Peter Vajda petvajda at YAHOO.COM
Fri Jun 4 10:54:24 CEST 2004


Hi,

I am writing a performance test application for an
HTTPS server with M2Crypto. All clients will load same
time the server and should use the same certificate
and primary key. I would like that the files (cert,
key) just read once during initialization. I made the
following class but after the handshake my application
is stuck no response.
Could somebody help what should be the problem?

Thanks
Peter Vajda

class MyHTTPSConnection(HTTPSConnection):
    try:
        Rand.load_file('./httpsd/randpool.dat', -1)
        ctx=SSL.Context('sslv23')
        ctx.load_cert(CERT_FILE, KEY_FILE)
        ctx.set_verify(SSL.verify_none, 0)
        ctx.set_info_callback()
    except: raise

    def __init__(self, host):
        try:
            server, port=host.split(':')
            self.conn=HTTPSConnection(server,
string.atoi(port),
                ssl_context=MyHTTPSConnection.ctx)
            self.set_debuglevel(1)
        except: raise

    def request(self, method, url, body=None,
headers={}):
        return self.conn.request(method, url, body,
headers)

    def getresponse(self):
        return self.conn.getresponse()








__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/




More information about the python-crypto mailing list