[PYTHON-CRYPTO] m2crypto blocking all other threads
heikki at OSAFOUNDATION.ORG
Thu Sep 22 06:51:43 CEST 2005
Rune Froysa wrote:
> I'm using m2crypto for a SSL-based xmlrpc service. This service is
> frequently DOSed by what appears to be a bug in m2crypto: it blocks
It seems like this is user error. In a multithreaded application you
need to initialize M2Crypto for threading. With those changes your
sample works for me. See below:
> #!/usr/bin/env python
> import sys, time, threading
from M2Crypto import threading as m2threading
> sys.path.insert(0, demo_dir)
> from https_srv import *
> def my_wt():
> while True:
> print "test"
> if __name__ == '__main__':
> ctx = init_context('sslv23', '%s/server.pem' % demo_dir, '%s/ca.pem' % demo_dir,
> httpsd = HTTPS_Server(('', 9443), HTTP_Handler, ctx)
> BTW: under 0.15, the https_srv.py complains from line 126 -> SSL/Context.py: 118:
> TypeError: ssl_ctx_load_verify_locations() argument 3 must be string, not None
This does not happen for me.
Please note that I did find a bug in Connection.py regarding handling of
post connection checks and just fixed them.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 253 bytes
Desc: OpenPGP digital signature
More information about the python-crypto