how to compile https support into Python2.0

Dustin Boswell boswell at
Fri Feb 16 00:47:07 CET 2001

I originally posted a question asking how to get Python to support
urls like so you could use urllib.urlopen()

After a bunch of searching on the web, here's what I did (on Redhat 6.2)

to get the Python Distribution to compile correctly with SSL...

(If it doesn't work, or there's an easier/better way, please correct

This is a package that you need to have installed before you
can build the Python source distribution (in the SSL way).

1) go to
 and download openssl-0.9.6.tar.gz
2) gunzip openssl-0.9.6.tar.gz
3) tar -xvf openssl-0.9.6.tar (make sure you are in the
directory you want to put the source in; this can be in
any temporary place, since the build will automatically
place it in the right spot later)
4) cd openssl-0.9.6
5) read the INSTALL file and...
6) ./config ; make ; make test ; make install
7) if that didn't work, I can't help you

This should have installed files into a /usr/local/ssl
directory (along with various others)

Here's where and how to build a Python interpreter..

1) Go to
   and download BeOpen-Python-2.0.tar.gz
2) gunzip BeOpen-Python-2.0.tar.gz
3) tar -xvf BeOpen-Python-2.0.tar ( same deal as step 3 above )
4) goto

        and make sure you have fresh copies of:
        - Modules/socketmodule.c
        - Lib/
        - Lib/
        - (possilby others, although I didn't, and haven't (yet) run
        into problems
5) in Python-2.0/Modules/ do:
     cp Setup
6) emacs (or, gulp, vi if you prefer) Setup
7) uncomment the four lines so that it looks like:
# Socket module compiled with SSL support; you must edit the SSL
_socket socketmodule.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto

8) in the top directory ( Python-2.0/ ) do ...
        ./configure ; make ; make test (took a while) ; make install

Dustin Boswell
boswell at

More information about the Python-list mailing list