Diese Anleitung führt Sie Schritt für Schritt durch den Build von OpenSSL für Windows 64-bit.
Stellen Sie sicher, dass alle Tools installiert sind:
D:\Projects\openssl-3.6.0\src→ 1. Vorbereitung → 2. Quellen
Das Build-Skript automatisiert alle Schritte:
# Build starten (aus beliebigem Verzeichnis) powershell.exe -ExecutionPolicy Bypass -File "D:\Projects\openssl-3.6.0\build_openssl.ps1"
Das Skript:
D:\Projects\openssl-3.6.0\bin→ Weiter zu 4. Testen
Falls Sie jeden Schritt verstehen möchten:
Öffnen Sie eine normale CMD (nicht PowerShell!) und führen Sie aus:
REM Pfad anpassen: Community, Professional oder Enterprise call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
Was passiert hier?
vcvars64.bat setzt wichtige Umgebungsvariablen:
PATH - Pfad zu cl.exe, link.exe, nmake.exeINCLUDE - Pfad zu Header-DateienLIB - Pfad zu LibrariesPrüfung:
cl
Erwartete Ausgabe:
Microsoft (R) C/C++ Optimizing Compiler Version 19.xx.xxxxx for x64
set PATH=C:\Strawberry\perl\bin;%LOCALAPPDATA%\bin\NASM;%PATH%
Prüfung:
perl -v nasm -v
cd /d D:\Projects\openssl-3.6.0\src
perl Configure VC-WIN64A --prefix=D:\Projects\openssl-3.6.0\bin --openssldir=D:\Projects\openssl-3.6.0\bin\ssl
Erklärung:
| Parameter | Bedeutung |
| ———– | ———– |
VC-WIN64A | Visual C++, Windows 64-bit, AMD64-Architektur |
–prefix=… | Wo die fertigen Dateien installiert werden |
–openssldir=… | Wo Konfigurationsdateien gespeichert werden |
Ausgabe (Beispiel):
Configuring OpenSSL version 3.6.0 for target VC-WIN64A Using os-specific seed configuration Creating configdata.pm Running configdata.pm Creating makefile ********************************************************************** *** *** *** OpenSSL has been successfully configured *** *** *** *** Configuration summary *** *** *** **********************************************************************
nmake
Dauer: 10-30 Minuten je nach Hardware. Geduld!
Was passiert?
Fehler? → Troubleshooting
nmake install_sw
install_sw installiert nur Software (ohne Dokumentation). Für alles: nmake install
Nach erfolgreichem Build finden Sie in D:\Projects\openssl-3.6.0\bin:
bin\
├── bin\
│ ├── openssl.exe # Kommandozeilen-Tool
│ ├── libcrypto-3-x64.dll # Kryptographie-Bibliothek
│ └── libssl-3-x64.dll # TLS-Bibliothek
├── include\
│ └── openssl\ # Header für C/C++ Entwicklung
├── lib\
│ ├── libcrypto.lib # Import-Library für Linker
│ ├── libssl.lib
│ └── ossl-modules\ # Provider-Module (default, legacy)
└── ssl\
└── openssl.cnf # OpenSSL Konfiguration
D:\Projects\openssl-3.6.0\bin\bin\openssl.exe version -a
Erwartete Ausgabe:
OpenSSL 3.6.0 11 Feb 2025 (Library: OpenSSL 3.6.0 11 Feb 2025) built on: ... platform: VC-WIN64A options: bn(64,64) compiler: cl /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 ...
Falls Sie das Build-Skript selbst erstellen möchten:
# build_openssl.ps1 - OpenSSL 3.6.0 Build Script $ErrorActionPreference = "Stop" Write-Host "========================================" -ForegroundColor Cyan Write-Host "OpenSSL 3.6.0 Build Script" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan # Pfade $projectRoot = "D:\Projects\openssl-3.6.0" $srcDir = "$projectRoot\src" $binDir = "$projectRoot\bin" $vsPath = "C:\Program Files\Microsoft Visual Studio\2022\Community" $vcvarsPath = "$vsPath\VC\Auxiliary\Build\vcvars64.bat" # Visual Studio Umgebung laden Write-Host "`n[1/5] Lade Visual Studio Umgebung..." -ForegroundColor Yellow $pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo.FileName = "cmd.exe" $pinfo.RedirectStandardOutput = $true $pinfo.UseShellExecute = $false $pinfo.Arguments = "/c `"`"$vcvarsPath`" && set`"" $p = New-Object System.Diagnostics.Process $p.StartInfo = $pinfo $p.Start() | Out-Null $output = $p.StandardOutput.ReadToEnd() $p.WaitForExit() $output -split "`r`n" | ForEach-Object { if ($_ -match "^([^=]+)=(.*)$") { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], "Process") } } # PATH setzen Write-Host "[2/5] Setze PATH für Perl und NASM..." -ForegroundColor Yellow $env:PATH = "C:\Strawberry\perl\bin;$env:LOCALAPPDATA\bin\NASM;$env:PATH" # Zum Quellverzeichnis wechseln Set-Location $srcDir # Altes Makefile löschen if (Test-Path "makefile") { Remove-Item "makefile" -Force } # Konfigurieren Write-Host "[3/5] Konfiguriere OpenSSL..." -ForegroundColor Yellow & perl Configure VC-WIN64A --prefix=$binDir --openssldir=$binDir\ssl if ($LASTEXITCODE -ne 0) { throw "Configure fehlgeschlagen!" } # Kompilieren Write-Host "[4/5] Kompiliere OpenSSL..." -ForegroundColor Yellow & nmake if ($LASTEXITCODE -ne 0) { throw "nmake fehlgeschlagen!" } # Installieren Write-Host "[5/5] Installiere..." -ForegroundColor Yellow & nmake install_sw if ($LASTEXITCODE -ne 0) { throw "Installation fehlgeschlagen!" } Write-Host "`n========================================" -ForegroundColor Green Write-Host "BUILD ERFOLGREICH!" -ForegroundColor Green Write-Host "Binaries in: $binDir" -ForegroundColor Green Write-Host "========================================" -ForegroundColor Green
Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional