pyOpenSSL in Python 3.3

Asked by serdmanczyk on 2013-05-08

Is there a plan to release a version for Python 3.3?

I've been attempting to use the Python 3.2 release (Windows 32) with my python 3.3 installation unsuccessfully.

I've attempted to install it over my python 3.3 installation but it's unrecognized by the pyftpdlib I'm using (latest version 1.2.0)
If I download the source and attempt to use the setup.py myself I get build errors on the crypto libraries.

I ask because I need pyOpenSSL to do secure connections with pyftpdlib (it's secure handler uses the pyOpenSSSL library).

If I revert my Python version back to 3.2 I'm able to succesfully use pyOpenSSL and pyftpdlib to make a secure FTP server. Unfortunately reverting my Python version isn't an option since for the setup my company ships with our application Python 3.3 is the version that is installed.

Question information

Language:
English Edit question
Status:
Solved
For:
pyOpenSSL Edit question
Assignee:
No assignee Edit question
Solved by:
serdmanczyk
Solved:
2013-05-09
Last query:
2013-05-09
Last reply:
Jean-Paul Calderone (exarkun) said : #1

No plans as such, really. If you're really stuck without one, I could try to put one together. Only... I see I don't actually have a Windows machine with Python 3.3 installed on it. That makes it a bit harder.

Matej (mcepl) said : #2

This must be just matter of recompilation or something. We have pyOpenSSL in Fedora for python 3.3 and it just works. The patches we have don't seem to have anything to do with python 3.3 either (one replaces lynx with elinks, the other does something to the PDF generation of the manual).

Jean-Paul Calderone (exarkun) said : #3

I hope it's just a matter of recompilation, yes. There's always room for a surprise or two ;) But Python 3.2 and Python 3.3 aren't very far apart.

serdmanczyk (serdmanczyk) said : #4

We're attempting to recompile pyOpenSSL with our setup here with not much success.

We're using OpenSSL-Win32 1.0.1e, Microsoft Visual Studio 9.0, and trying to install pyOpenSSL-0.11.

Here's a brief snippet of the errors when running setup.h:

running install
running build
running build_py
running build_ext
building 'OpenSSL.crypto' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python33\include -IC:\Python33\include -IC:\OpenSSL-Win32\include /TcOpenSSL/crypto/crypto.c /Fobuild\temp.win32-3.3\Release\OpenSSL/crypto/crypto.obj
crypto.c
c:\users\steven.erdmanczyk\desktop\ftpinstalls\pyopenssl\pyopenssl-0.11\openssl\crypto\x509name.h(27) : error C2059: syntax error : '('
c:\users\steven.erdmanczyk\desktop\ftpinstalls\pyopenssl\pyopenssl-0.11\openssl\crypto\x509name.h(30) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(192) : error C2059: syntax error : '('
C:\OpenSSL-Win32\include\openssl/x509v3.h(200) : error C2059: syntax error : 'type'
C:\OpenSSL-Win32\include\openssl/x509v3.h(204) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(205) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(211) : error C2061: syntax error : identifier 'GENERAL_NAME'
C:\OpenSSL-Win32\include\openssl/x509v3.h(212) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(231) : error C2059: syntax error : '('
C:\OpenSSL-Win32\include\openssl/x509v3.h(232) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(249) : error C2016: C requires that a struct or union has at least one member
C:\OpenSSL-Win32\include\openssl/x509v3.h(249) : error C2061: syntax error : identifier 'DIST_POINT_NAME'
C:\OpenSSL-Win32\include\openssl/x509v3.h(253) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(323) : error C2016: C requires that a struct or union has at least one member
C:\OpenSSL-Win32\include\openssl/x509v3.h(323) : error C2061: syntax error : identifier 'GENERAL_NAME'
C:\OpenSSL-Win32\include\openssl/x509v3.h(326) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(358) : error C2016: C requires that a struct or union has at least one member
C:\OpenSSL-Win32\include\openssl/x509v3.h(358) : error C2061: syntax error : identifier 'DIST_POINT_NAME'
C:\OpenSSL-Win32\include\openssl/x509v3.h(364) : error C2059: syntax error : '}'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing '{' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing ')' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing '{' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2059: syntax error : ')'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing '{' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing ')' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2143: syntax error : missing '{' before '*'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2040: 'a' : 'int **' differs in levels of indirection from 'int *'
C:\OpenSSL-Win32\include\openssl/x509v3.h(524) : error C2059: syntax error : 'type'
....
....
....
C:\OpenSSL-Win32\include\openssl/x509v3.h(577) : fatal error C1003: error count exceeds 100; stopping compilation

Jean-Paul Calderone (exarkun) said : #5

Why pyOpenSSL 0.11? I suggest going with pyOpenSSL 0.13 instead. Earlier releases are known not to compile against OpenSSL 1.0

serdmanczyk (serdmanczyk) said : #6

Ah, ok. I attempted compiling again with pyOpenSSL 0.13 and it works this time. Pyftpdlib is now running using TLS/SSL as well! Thanks much!

I've actually attempted compiling this twice for experimentation, once with the MS VC90 compiler and once with the VC100 compiler. With the VC90 compiler I get the same problems trying to run as if I had just attempted to install the Python 3.2 version of pyOpenSSL. I think the only thing preventing the current version of pyOpenSSL from running with Python 3.3 is that it's compiled with a different version of visual studio (Python 3.3 is compiled with VC100 from what I hear). Hope that helps future people with this problem!

serdmanczyk (serdmanczyk) said : #7

Ah, ok. I attempted compiling again with pyOpenSSL 0.13 and it works this time. Pyftpdlib is now running using TLS/SSL as well! Thanks much!

I've actually attempted compiling this twice for experimentation, once with the MS VC90 compiler and once with the VC100 compiler. With the VC90 compiler I get the same problems trying to run as if I had just attempted to install the Python 3.2 version of pyOpenSSL. I think the only thing preventing the current version of pyOpenSSL from running with Python 3.3 is that it's compiled with a different version of visual studio (Python 3.3 is compiled with VC100 from what I hear). Hope that helps future people with this problem!