2024-06-04 18:29:19 +01:00
|
|
|
echo %*
|
2024-06-23 19:29:24 +01:00
|
|
|
IF "%~3" == "" ( set "ghSsl_repo=openssl-builds" ) ELSE ( set "ghSsl_repo=%~3" )
|
|
|
|
IF "%~2" == "" ( set "ghSsl_user=xanasoft" ) ELSE ( set "ghSsl_user=%~2" )
|
2024-10-18 16:40:56 +01:00
|
|
|
IF "%~1" == "" ( set "openssl_version=3.3.2" ) ELSE ( set "openssl_version=%~1" )
|
2024-06-04 18:29:19 +01:00
|
|
|
|
|
|
|
set "openssl_version_underscore=%openssl_version:.=_%"
|
2021-10-16 16:19:51 +01:00
|
|
|
|
2022-07-03 08:56:23 +01:00
|
|
|
mkdir %~dp0\OpenSSL
|
2021-10-16 16:19:51 +01:00
|
|
|
|
2024-06-04 18:29:19 +01:00
|
|
|
rem https://github.com/<repo>/openssl/releases/download/OpenSSL_1_1_1p/OpenSSL-1_1_1p.zip
|
|
|
|
rem https://github.com/<repo>/openssl/releases/download/openssl-3.3.0/openssl-3.3.0.zip
|
|
|
|
curl -L -f --url https://github.com/%ghSsl_user%/%ghSsl_repo%/releases/download/OpenSSL_%openssl_version_underscore%/OpenSSL-%openssl_version_underscore%.zip -o %~dp0\OpenSSL\OpenSSL-%openssl_version%.zip --ssl-no-revoke
|
|
|
|
IF %ERRORLEVEL% EQU 0 goto done
|
|
|
|
curl -L -f --url https://github.com/%ghSsl_user%/%ghSsl_repo%/releases/download/openssl-%openssl_version%/openssl-%openssl_version%.zip -o %~dp0\OpenSSL\OpenSSL-%openssl_version%.zip --ssl-no-revoke
|
|
|
|
IF %ERRORLEVEL% EQU 0 goto done
|
|
|
|
|
|
|
|
:urlfallback
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
set "opensslFolders=openssl- openssl_ OpenSSL- OpenSSL_"
|
|
|
|
set "opensslFiles=openssl- openssl_ OpenSSL- OpenSSL_"
|
|
|
|
set "opensslVersions=%openssl_version% %openssl_version_underscore%"
|
|
|
|
for %%i in (%opensslFolders%) do (
|
|
|
|
echo 1=%%i
|
|
|
|
for %%j in (%opensslFiles%) do (
|
|
|
|
echo 2=%%j
|
|
|
|
for %%k in (%opensslVersions%) do (
|
|
|
|
echo 3=%%k
|
|
|
|
for %%l in (%opensslVersions%) do (
|
|
|
|
echo 4=%%l
|
|
|
|
timeout 2 >nul
|
|
|
|
curl -L -f --url https://github.com/%ghSsl_user%/%ghSsl_repo%/releases/download/%%i%%k/%%j%%l.zip -o %~dp0\OpenSSL\OpenSSL-%openssl_version%.zip --ssl-no-revoke
|
|
|
|
IF !ERRORLEVEL! EQU 0 goto done
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
echo No valid URL found.
|
|
|
|
if %ERRORLEVEL% NEQ 0 exit /b 404
|
|
|
|
endlocal
|
|
|
|
|
|
|
|
:done
|
|
|
|
|
|
|
|
"C:\Program Files\7-Zip\7z.exe" x -bd -o%~dp0\OpenSSL\ %~dp0\OpenSSL\OpenSSL-%openssl_version%.zip
|
|
|
|
|