Skip to content

How to Build OpenSSL 1.0 on Windows

Günter Obiltschnig edited this page Aug 14, 2018 · 9 revisions

In order to build OpenSSL on Windows for use with POCO using Visual Studio 2015, follow these steps:

Note: this covers OpenSSL 1.0. For OpenSSL 1.1, see here (coming soon).

Set Up Prerequisites

Download and install the following software packages:

  • 7-Zip to unpack the OpenSSL source code archive (.tar.gz)
  • Perl (ActiveState) in order to build OpenSSL

Get OpenSSL Sources

  • Get the OpenSSL sources from the OpenSSL Downloads Page.
  • Unpack the source code package (openssl-1.0.2o.tar.gz) using 7-zip. This is a two-step process. First, expand the GZip-compressed .tar.gz, then unpack the openssl-1.0.2o.tar file, resulting in a directory named openssl-1.0.2o.

Build OpenSSL Libraries (32 bit)

Launch a VS2015 x86 Native Tools Command Prompt and cd into the openssl-1.0.2o directory. Then run the following commands below.

Note: each configuration (static, DLL, 32-bit, 64-bit) must be built in a fresh directory.

Configure OpenSSL

Configure OpenSSL to be installed into C:\OpenSSL-Win32. You can of course also specify a different directory.

> perl Configure VC-WIN32 no-asm --prefix=C:\OpenSSL-Win32
> ms\do_ms

Build OpenSSL Libraries (static)

> nmake -f ms\nt.mak 

Install OpenSSL Libraries (static)

This will install the libraries, executables and header files into the directory specified in the Configure step.

> nmake -f ms\nt.mak install

Build OpenSSL Libraries (DLL)

> nmake -f ms\ntdll.mak 

Install OpenSSL Libraries (DLL)

This will install the libraries, executables and header files into the directory specified in the Configure step.

> nmake -f ms\ntdll.mak install

Congratulations, you have successfully built OpenSSL.

Build OpenSSL Static Libraries (64 bit)

Launch a VS2015 x64 Native Tools Command Prompt and cd into a freshly extracted the openssl-1.0.2o directory. Then run the commands below.

Configure OpenSSL

Configure OpenSSL to be installed into C:\OpenSSL-Win64. You can of course also specify a different directory.

> perl Configure VC-WIN64A no-asm --prefix=C:\OpenSSL-Win64
> ms\do_win64a

Build OpenSSL Libraries (static)

> nmake -f ms\nt.mak 

Install OpenSSL Libraries (static)

This will install the libraries, executables and header files into the directory specified in the Configure step.

> nmake -f ms\nt.mak install

Build OpenSSL Libraries (DLL)

> nmake -f ms\ntdll.mak 

Install OpenSSL Libraries (DLL)

This will install the libraries, executables and header files into the directory specified in the Configure step.

> nmake -f ms\ntdll.mak install