Skip to content

Instantly share code, notes, and snippets.

@jborbely
Created November 6, 2024 21:08
Show Gist options
  • Select an option

  • Save jborbely/5952a2cb822e800513ca6921556ebc66 to your computer and use it in GitHub Desktop.

Select an option

Save jborbely/5952a2cb822e800513ca6921556ebc66 to your computer and use it in GitHub Desktop.
Build OpenSSL from source on Windows
@echo off
set OPENSSL_VERSION=3.4.0
REM Dependencies
REM * MSVC build tools (https://visualstudio.microsoft.com/vs/community/)
REM > winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348"
REM * git (https://git-scm.com/downloads/win)
REM > winget install Git.Git
REM * perl (https://strawberryperl.com/)
REM > winget install StrawberryPerl.StrawberryPerl
REM * nasm (https://www.nasm.us/) Optional dependency
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
if not %ERRORLEVEL% == 0 goto :abort
echo.
git -v
if not %ERRORLEVEL% == 0 goto :abort
set PATH=C:\Strawberry\perl\bin;%PATH%
perl -v
if not %ERRORLEVEL% == 0 goto :abort
set PATH=C:\Program Files\NASM;%PATH%
nasm -v
if not %ERRORLEVEL% == 0 set ASM_OPTION=no-asm
echo.
git clone --branch openssl-%OPENSSL_VERSION% --depth 1 https://github.com/openssl/openssl.git
cd openssl
echo.
echo.Configuring with options: VC-WIN64A no-shared no-docs no-tests %ASM_OPTION%
perl Configure VC-WIN64A no-shared no-docs no-tests %ASM_OPTION%
nmake
cp apps/openssl.exe ..
cd ..
echo.
echo.Done!
echo.Built %~dp0openssl.exe
:abort
echo.
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment