Python SSL support in Windows and opening MSI files

Wednesday 16 May 2007

If you install ActivePython, you will not have SSL support installed. The socket module from the standard library will not have the ssl() function defined, because the _ssl.pyd dynamic library is missing, at least for Python 2.4. Maybe they've included it in the Python 2.5 kits.

One solution is to install the Python distribution from python.org, but I didn't want to do that because I like the other extras that ActivePython gives me. The other solution is to find the _ssl.pyd file from the Python distribution that matches your version of Python:

  • Download the .msi from the python.org download area. If the exact version you need isn't listed, find a close one and edit the URL: there are older versions that aren't advertised on the main page.
  • Download lessmsi, a handy tool for opening up .msi files as if they were simple zip files.
  • Find the file _ssl.pyd in the .msi file and place it into your Python\DLLs directory.

You now have SSL support!

Comments

[gravatar]
Trent Mick 12:27 PM on 17 May 2007

Ack. *Yes*, SSL support is included in ActivePython 2.5 builds. The ActivePython 2.4 builds haven't been updated since we got export approval to include crypto.
(Note: I'm the ActivePython guy at ActiveState.)

[gravatar]
Corey Goldberg 4:35 PM on 17 May 2007

I ran into this a few weeks ago. I had ActivePython 2.4 and couldn't do SSL. Installing the standard Python 2.4 (from python.org) fixed the problem.

This morning I installed ActivePython 2.5 and the prob is indeed fixed.

[gravatar]
Ned Batchelder 6:26 PM on 17 May 2007

Trent, I figured you would chime in with the details (I almost put a "Hi Trent!" in the post itself!)

Corey, good to have confirmation that 2.5 doesn't have the problem...

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.