Skip to content

Build OpenSSL on Windows with MSYS2

In this tutorial, we are going to build/compile OpenSSL on Windows with MSYS2.

Download and Install MSYS2 shell, from https://www.msys2.org/

Download and install Strawberry Perl from http://strawberryperl.com/ 

After installation open the MSYS2 shell and install the make and GCC modules into the MSYS2 environment

Install make using pacman -S make into the MSYS2 environment

$ pacman -S make

Install the GCC compiler and other tools into the MSYS2 environment using the below command.

$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain

Download the OpenSSL source code from the GitHub release page – Below is the link to the latest release files.

https://github.com/openssl/openssl/archive/refs/tags/openssl-3.0.7.zip

In the MSYS2 shell do the configuration depending on the target architecture:

$ cd d:\openssl-openssl-3.0.7\
$ perl Configure mingw64 no-shared no-asm --prefix=/d/OpenSSL
$ make depend
$ make
$ make install
$ make clean

you will get similar files and folders after a successful build.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments