Difference between revisions of "Using Python HTTPSConnect"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) |
PeterHarding (talk | contribs) m |
||
Line 30: | Line 30: | ||
[[ | [[Category:Python]] |
Latest revision as of 15:49, 10 April 2017
Problems
Had a problem where httplib.HTTPSConnect() was not available. Happens when Python is not built with SSL support. To get this working I need to do the following:
- . Download latest version of OpenSSL from http://www.openssl.org/ and install it (/usr/local/ssl)
- . Had to use the -fPIC compile flag to get the linker to work later in the process
- . Update Modules/Setup file - uncomment SSL lines.
- . Build and install Python
Other things
In OpenSSL source directory run config as follows:
./config --openssldir=/usr/local/ssl
Add -fPIC to end of CFLAGS line in Makefile before building:
CFLAG= -DOPENSSL_THREADS -D_REENTRANT ... -DGHASH_ASM -fPIC
In python source directory run configure to build for a custom location:
./configure --enable-shared --prefix=/usr/local/python LDFLAGS="-Wl,-rpath /usr/local/python/lib"
Also had a go at building pyOpenSSL. Once OpenSSL was installed needed to update the setup.py with the OpenSSL locations as follows:
IncludeDirs = ['/usr/local/ssl/include'] LibraryDirs = ['/usr/local/ssl/lib']