Installing OpenSSL on Windows

The following is my personal successful experience installing OpenSSL on Windows. However, my machine is loaded with development tools, so there is a chance that there is something installed on my computer that is not mentioned here and, unknowingly, serving some function. However, I’m pretty sure I’ve got most of it.

UPDATE:. I am also told that following my instructions may or may not result in a healthy binary, although it seemed to work for me. (Thanks to Thomas Hruska and the openssl.org users list for the info)

[i:18d3bd8262]– original walkthrough (ie, the hard way) –

A. Requirements:

1. Visual C++ (which, unfortunately is not a free software) You can download nmake.exe by itself from [url]http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe[/url] however I am told that OpenSSL will only compile successfully if you have the full version of Visual C++.

2. ActiveState Perl. This can be downloaded freely from [url]http://www.activestate.com/[/url]

3. Some way of decompressing a tar.gz file. If you don’t already have anything, I recomment IZArc, which can be downloaded from [url]http://www.izsoft.dir.bg/izarc.htm[/url]. If you are familiar with unpacking tar.gz on unix, then you can use UNIX Utils (see below) instead.

4. UNIX Utils – obtained at [url]http://unxutils.sourceforge.net/[/url]. I don’t know for a fact that this is required, however I notice that compiles will many times fail because tar or gz or some other trivial unix command is not available. If you notice any such errors during compile, grab UNIX utils. If you do much compiling, just grab it anyway.

5. MASM assembler. Download it from [url]http://www.masm32.com/[/url] (this gets installed into your VC++ bin directory)

B. Preparation:

For VC++, if you didn’t elect to configure the command-line environment variables during installation, then you should run the batch file vcvars32.bat (which is in the VC++ directories somewhere) to set them.

MASM should include a bin directory and the contents are supposed to be installed into your VC++ bin directory as well. If you put them somewhere else, make sure this location is in your Path.

Make sure the path to Perl executable is in your Path.

Make sure the path to UNIX utils is in your Path. (I don’t know that this is absolutely necessary, but I have it set this way)

C. Installation

If everything is all set, installation should go as planned:

1. Download OpenSSL source from [url]http://www.openssl.org/[/url]. You will want to download the tar.gz that is marked as the “Latest” release.

2. Extract the tar.gz file using whatever method you like. Move this directory to “C:\OSSL” (this is an arbitrary location for the purposes of easy explaination)

3. Open a DOS window, move to the C:\OSSL directory, and execute the following commands: (These instructions are taken from install.w32 which is included in the OpenSSL install folder. I suggest you read it.)

> perl Configure VC-WIN32
> ms\do_masm
> nmake -f ms\ntdll.mak

If everything went ok, you’ll not see any error messages. If you do, the message should give some clue. Things like “ml not a valid command” etc indicate you don’t have your environmental paths set up correctly.

Now that OpenSSL is compiled, there are are some tests you can run to make sure it’s ok. Read install.w32 for info about these. Finally, you can move the necessary parts to their permenant home on your system. install.w32 recommends the following dos commands to do the trick (you can use windows explorer, though):

> md c:\openssl
> md c:\openssl\bin
> md c:\openssl\lib
> md c:\openssl\include
> md c:\openssl\include\openssl
> copy /b inc32\openssl\* c:\openssl\include\openssl
> copy /b out32dll\ssleay32.lib c:\openssl\lib
> copy /b out32dll\libeay32.lib c:\openssl\lib
> copy /b out32dll\ssleay32.dll c:\openssl\bin
> copy /b out32dll\libeay32.dll c:\openssl\bin
> copy /b out32dll\openssl.exe c:\openssl\bin

Open SSL should be compiled and available now.

One Response to “Installing OpenSSL on Windows”

  1. Bob December 28, 2011 at 9:43 am #

    Hi,

    Just FYI, you can build and use OpenSSL with only free software using the MinGW-w64 toolchain. There is a description at http://www.blogcompiler.com/2011/12/21/openssl-for-windows/ for how to do it.

    It supports both x86 and x64 Windows platforms.

Leave a Reply

Please leave these two fields as-is: