Monday, 6 August 2007

OpenSSL on Windows

OK, to get the usual intro over and done with - blog, neglected, back now, very sorry, won't do it again.

And now onto business... Ben West reported a problem with pgAdmin III v.1.8.0 Beta 2 on Windows which seems to have gained a dependency on MSVCR71.DLL (that's the Visual C++ runtime library for VC++ 7.1). pgAdmin is built with VC++ 8 these days so we really don't want to ship the 7.1 runtimes. After a little investigation, it seems that the latest builds of OpenSSL from Shining Light Productions are built using VC++ 7.1 :-(

So, it seems we need to build OpenSSL ourselves now to avoid this issue. I struggled to find the details of how to do that, so after finding the relevant info elsewhere, I'll repeat it here for future reference...

So, here's how it's done. You will need something to unpack the OpenSSL source code (such as tar with gzip support), and a perl installation, as well as VC++.

  1. Download the OpenSSL Source.

  2. Start a Visual Studio command prompt for the version of Visual C++ you need to compile against (8.0 for us, otherwise known as 2005).

  3. Unpack the OpenSSL source, and CD into the source directory.

  4. Configure the source code:

    C:\openssl-0.9.8e> perl configure VC-WIN32

  5. Generate assembler code for speed:

    C:\openssl-0.9.8e> ms\do_masm

  6. Finally, the libraries can be built:

    C:\openssl-0.9.8e> nmake -f ms\ntdll.mak

And that's it! The OpenSSL DLLs should be found in the out32dll directory.