Compiling OpenSSL with Visual Studio (2024)

The following sections describes how to compile OpenSSL 3.0.x for Visual Studio 2008 and higher without patented algorithms.

NASM (https://www.nasm.us/)
Perl (https://www.activestate.com/products/activeperl/)

Download the latest version of OpenSSL from here http://www.openssl.org/source/
Extract the OpenSSL tar to <SDK Installation Directory>\third-party\build_ssl.
That will create a new folder <SDK Installation Directory>\third-party\build_ssl\openssl-<version_number>.

Navigate to <SDK Installation Directory>\third-party\build_ssl and create a new file env_no_VS.bat with the following content:

@echo off

set OPENSSL_VERSION=3.0.8

PATH=C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\

REM PATH for Perl

where /q "C:\Perl\bin:perl.exe"

if errorlevel 1 (

where /q "C:\Perl64\bin:perl.exe"

if errorlevel 1 (

echo perl cannot be found. please ensure it is installed and placed in your path.

pause

exit /b

) else (

PATH=C:\Perl64\bin;C:\Perl64\site\bin;%PATH%

)

) else (

PATH=C:\Perl\bin;C:\Perl\site\bin;%PATH%

)

REM PATH for NASM

where /q "C:\Program Files (x86)\NASM:nasm.exe"

if errorlevel 1 (

where /q "C:\Program Files\NASM:nasm.exe"

if errorlevel 1 (

echo nasm cannot be found. please ensure it is installed and placed in your path.

pause

exit /b

) else (

PATH=C:\Program Files\NASM;%PATH%

)

) else (

PATH=C:\Program Files ^(x86^)\NASM;%PATH%

)

SET INCLUDE=

SET LIB=

SET LIBPATH=

That will setup the environment you need to use the following build scripts.

The following example code uses paths for VS2015. For other versions of Visual Studio you need to adapt the paths. Create a folder <SDK Installation Directory>\third-party\build_ssl\vs2015. In that folder create the following batch files.

To build 32bit release libraries create the file build_win32_vs2015_release.cmd:

@echo off

setlocal

call ..\env_no_VS.bat

REM setup environment

set VS_ENV_BAT="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"

set BUILD_CONFIG=win32-vs2015

set CONFIG_ARCH=VC-WIN32

set REPLACE_ARCH=

set DEBUG_POSTFIX=

CALL %VS_ENV_BAT%

REM create a copy of the source dir

xcopy ..\openssl-%OPENSSL_VERSION% openssl-%BUILD_CONFIG%\ /s /e

REM set target dir

set TARGET_DIR=%cd%\openssl-%OPENSSL_VERSION%-%BUILD_CONFIG%-DLL

cd openssl-%BUILD_CONFIG%

REM prefix is the target directory

perl Configure no-idea no-mdc2 no-rc5 no-ssl3 no-deprecated %CONFIG_ARCH% --api=3.0 --prefix=%TARGET_DIR%

nmake build_libs

nmake install_dev

REM delete build directory

cd ..

RMDIR /S /Q openssl-%BUILD_CONFIG%

To build 64bit release libraries create the file build_win64_vs2015_release.cmd:

@echo off

setlocal

call ..\env_no_VS.bat

REM setup environment

set VS_ENV_BAT="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"

set BUILD_CONFIG=win64-vs2015

set CONFIG_ARCH=VC-WIN64A

set REPLACE_ARCH=-x64

set DEBUG_POSTFIX=

CALL %VS_ENV_BAT%

REM create a copy of the source dir

xcopy ..\openssl-%OPENSSL_VERSION% openssl-%BUILD_CONFIG%\ /s /e

REM set target dir

set TARGET_DIR=%cd%\openssl-%OPENSSL_VERSION%-%BUILD_CONFIG%-DLL

cd openssl-%BUILD_CONFIG%

REM prefix is the target directory

perl Configure no-idea no-mdc2 no-rc5 no-ssl3 no-deprecated %CONFIG_ARCH% --api=3.0 --prefix=%TARGET_DIR%

nmake build_libs

nmake install_dev

REM delete build directory

cd ..

RMDIR /S /Q openssl-%BUILD_CONFIG%

To execute all build scripts in one go create a batch file with the following content:

@echo off

call build_win32_vs2015_release.cmd

call build_win64_vs2015_release.cmd

echo Build VS2015 Done

Check if the OpenSSL version in env_no_VS.bat matches the version of OpenSSL you want to build. Edit env_no_VS.bat to set the correct version:

set OPENSSL_VERSION=3.0.8

  • Open a command promp and navigate to <SDK Installation Directory>\third-party\build_ssl.
  • Execute the batch file env_no_VS.bat to configure the environment.
  • Enter the folder containing the build scripts e.g. vs2015
  • Execute the batch file build_all.cmd to build all or execute one of the files described above to build a single configuration of OpenSSL.

Finally, you need to copy the libaries and header files to the SDK folder structure. Create a folder named
<SDK Installation Directory>\third-party\win<32/64>\vs<version>\openssl

The folder might already exist if you built with the version of Visual Studio that you installed the SDK for.

  • Create a folder <SDK Installation Directory>\third-party\win<32/64>\vs<version>\openssl.
  • Copy the folders bin include and lib from the build directory to the openssl folder created above
Compiling OpenSSL with Visual Studio (2024)
Top Articles
Sell Art from Your Collection | Consignments | Artsy
Benefits and features of FlexiPay
Cottonwood Vet Ottawa Ks
Ets Lake Fork Fishing Report
Blanchard St Denis Funeral Home Obituaries
Craigslist Mpls Mn Apartments
³µ¿Â«»ÍÀÇ Ã¢½ÃÀÚ À̸¸±¸ ¸íÀÎ, ¹Ì±¹ Ķ¸®Æ÷´Ï¾Æ ÁøÃâ - ¿ù°£ÆÄ¿öÄÚ¸®¾Æ
Craigslist Portales
Craigslist Parsippany Nj Rooms For Rent
Craigslist Kennewick Pasco Richland
B67 Bus Time
South Ms Farm Trader
Voyeuragency
Signs Of a Troubled TIPM
Cooktopcove Com
Pittsburgh Ultra Advanced Stain And Sealant Color Chart
Nj State Police Private Detective Unit
Who called you from 6466062860 (+16466062860) ?
Kitty Piggy Ssbbw
Gemita Alvarez Desnuda
Who called you from +19192464227 (9192464227): 5 reviews
R Personalfinance
Gayla Glenn Harris County Texas Update
Noaa Duluth Mn
Nz Herald Obituary Notices
Www.dunkinbaskinrunsonyou.con
Talk To Me Showtimes Near Marcus Valley Grand Cinema
Booknet.com Contract Marriage 2
Mdt Bus Tracker 27
Giantbodybuilder.com
Trinket Of Advanced Weaponry
Kaliii - Area Codes Lyrics
Our 10 Best Selfcleaningcatlitterbox in the US - September 2024
Otis Inmate Locator
Angel del Villar Net Worth | Wife
Napa Autocare Locator
60 Second Burger Run Unblocked
Craigslist Gigs Norfolk
Gerber Federal Credit
Royals op zondag - "Een advertentie voor Center Parcs" of wat moeten we denken van de laatste video van prinses Kate?
Srg Senior Living Yardi Elearning Login
Muziq Najm
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Topos De Bolos Engraçados
Best Restaurants Minocqua
3 Zodiac Signs Whose Wishes Come True After The Pisces Moon On September 16
Stosh's Kolaches Photos
Das schönste Comeback des Jahres: Warum die Vengaboys nie wieder gehen dürfen
Meee Ruh
Makemkv Key April 2023
The Goshen News Obituary
Arnold Swansinger Family
Latest Posts
Article information

Author: Rob Wisoky

Last Updated:

Views: 6781

Rating: 4.8 / 5 (48 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Rob Wisoky

Birthday: 1994-09-30

Address: 5789 Michel Vista, West Domenic, OR 80464-9452

Phone: +97313824072371

Job: Education Orchestrator

Hobby: Lockpicking, Crocheting, Baton twirling, Video gaming, Jogging, Whittling, Model building

Introduction: My name is Rob Wisoky, I am a smiling, helpful, encouraging, zealous, energetic, faithful, fantastic person who loves writing and wants to share my knowledge and understanding with you.