[pyOpenSSL] PyEval_RestoreThread: NULL tstate

Dave Aitel dave at immunitysec.com
Sun Oct 6 21:29:16 CEST 2002


Does a tsafe connection not support this?
-dave

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.2/threading.py", line 408, in __bootstrap
    self.run()
  File "./spkproxy.py", line 700, in run
    self.connection.startSSLserver()
  File "./spkproxy.py", line 98, in startSSLserver
    self.mysocket.set_accept_state()
AttributeError: Connection instance has no attribute 'set_accept_state'

On Sun, 2002-10-06 at 14:22, Martin Sjögren wrote:
> sön 2002-10-06 klockan 19.28 skrev Dave Aitel:
> > On Sun, 2002-10-06 at 06:46, Martin Sjögren wrote:
> > 
> > > If you're running multithreaded, you'd do well to use
> > > OpenSSL.tsafe.Connection instead of OpenSSL.SSL.Connection (tsafe stands
> > > for thread safe :))
> > 
> > hmm. How does one do this exactly?
> > -dave
> > 
> > 
> >         self.mysocket = OpenSSL.tsafe.Connection(ctx, self.mysocket)
> >     self.mysocket = OpenSSL.tsafe.Connection(ctx, self.mysocket)
> > AttributeError: 'module' object has no attribute 'tsafe'
> 
> D'oh! I must have forgotten to import tsafe from the __init__.py file.
> If you do import OpenSSL.tsafe, or from OpenSSL import tsafe, it works.
> 
> 
> /Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/pyopenssl-users/attachments/20021006/4192e7eb/attachment.pgp>


More information about the pyopenssl-users mailing list