Issues compiling M2Crypto against Py2.6 and OpenSSL 0.9.8i on Win32 with MSVC 2008
Christian <[email protected]> Tue, 14 Oct 2008 15:41:21 +0200
| Newsgroups | gmane.comp.python.cryptography |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I migrated to Python 2.6 today and wanted reinstalled all third party
packages, which I had before on Python 2.5.2. But with M2Crypto 0.19.1 I
had some problems.
1) There are no binary build for Python 2.6, yet. So I decided to build
my own ones.
But that lead to more trouble.
2) There is a bug in OpenSSL 0.9.8.i, which breaks the build process.
You have to add a undef to the following block in x509.h:
#ifdef OPENSSL_SYS_WIN32
/* Under Win32 these are defined in wincrypt.h */
#undef X509_NAME
#undef X509_CERT_PAIR
#undef X509_EXTENSIONS
#endif
From:
http://rt.openssl.org/Ticket/Display.html?id=1700&user=guest&pass=guest
But I had some post building errors, when running my Python programs. It
seems, that their is at least one incompatibility with Python 2.6,
namely in the SSLServer. In Python 2.6 the underlying
SocketServer.BaseServer has a some extra initializing code (events to
stop serve_forever), which are not initialized in SSLServer (which is a
hard coded copy of the constructor). My solution would be to change:
self.server_address=server_address
self.RequestHandlerClass=RequestHandlerClass
to:
SocketServer.BaseServer.__init__(self, server_address,
RequestHandlerClass)
which calls the base constructor, to do the standard initialization.
---
Christian
PS: I have uploaded a binary installer for Python 2.6 to the Wiki. Which
actually have the bug in SSLServer.