Problems with thread state

Martin Sjögren martin at strakt.com
Wed Jul 4 02:45:29 EDT 2001


On Tue, Jul 03, 2001 at 10:17:27PM +0200, Laurent Szyster wrote:
> "Martin Sjögren" wrote:
> > 
> > I'm trying to write an OpenSSL module for Python (purely in C) and
> > I've run into a big problem.
> 
> There's allready a Python binding for OpenSSL: M2Crypto. Combining
> Medusa and M2Crypto is the fastest I can think of to develop an SSL
> network client or server.

I know of M2Crypto, and I've been looking at it long and seriously and
come to the conclusion that it doesn't fulfill my needs. I'm not bashing
the author, I've exchanged several mails with him, but I've got a few
issues with M2Crypto:

* It's not written entirely in C - while this might not be an issue, I'm
  not sure if the communications protocol I'm working on will be written
  in C or Python
* The exception handling is somewhat weird, and at several times (because
  of SWIG I guess) exceptions aren't raised where they should be.
* The objects sent with the exceptions are strings all the way, which is
  not very nice to compare over. Oh, except for when SetFromErrno is used,
  and I think that's used on a few places where it shouldn't too.

I guess I could patch most of this if I knew something about SWIG, but the
first issue - not being written in C - weighs heavily on my shoulders here
:)

> > Seeing as a call to SSL_connect() might block, I surrounded the call to it
> > by Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS. (...)
> 
> OpenSSL has non-blocking IO API calls.

Yes it's got non-blocking IO API calls, but I'm trying to develop a
general module here, one that supports blocking IO too, eventhough I may
not use it at all. After all, I want to do a good job, right?

-- 
Martin Sjögren
  martin at strakt.com              ICQ : 41245059
  Phone: +46 (0)31 405242        Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 248 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010704/84353c06/attachment.sig>


More information about the Python-list mailing list