我目前使用的是Windows 11,但我认为在Windows 10上的步骤应该是相同的。
我已经到处搜索了,没有一个教程能够成功地展示如何在Windows上安装OpenSSL。
这个网站上的所有答案都只是一些变通方法,例如使用Git版本。我特别使用XAMPP中的OpenSSL,但那不是我想要的。
我想要能够从源代码安装OpenSSL。此外,当前Git和XAMPP安装的是OpenSSL 1.1.1版本,而我想要的是OpenSSL 3。
我已经尝试了所有方法,但OpenSSL的说明缺乏信息。它们只是给出一些提示,然后是三个点(...),比如(./Configure...
)。
这就是我正在尝试跟随的步骤:
https://github.com/openssl/openssl/blob/master/NOTES-WINDOWS.md#native-builds-using-mingw
对于这个例子,我选择了MinGW方法(但是,如果您能够成功地通过其他方法安装它,那也可以,我也会这样做):我在Windows上安装了MSYS32和Perl,但是在MinGW部分卡住了,我已经在MSYS32上安装了MinGW - 我只是安装了工具链中的所有软件包:
$ pacman -S mingw-w64-ucrt-x86_64-toolchain
:: There are 19 members in group mingw-w64-ucrt-x86_64-toolchain:
:: Repository ucrt64
1) mingw-w64-ucrt-x86_64-binutils 2) mingw-w64-ucrt-x86_64-crt-git
3) mingw-w64-ucrt-x86_64-gcc 4) mingw-w64-ucrt-x86_64-gcc-ada
5) mingw-w64-ucrt-x86_64-gcc-fortran 6) mingw-w64-ucrt-x86_64-gcc-libgfortran
7) mingw-w64-ucrt-x86_64-gcc-libs 8) mingw-w64-ucrt-x86_64-gcc-objc
9) mingw-w64-ucrt-x86_64-gdb 10) mingw-w64-ucrt-x86_64-gdb-multiarch
11) mingw-w64-ucrt-x86_64-headers-git 12) mingw-w64-ucrt-x86_64-libgccjit
13) mingw-w64-ucrt-x86_64-libmangle-git 14) mingw-w64-ucrt-x86_64-libwinpthread-git
15) mingw-w64-ucrt-x86_64-make 16) mingw-w64-ucrt-x86_64-pkgconf
17) mingw-w64-ucrt-x86_64-tools-git 18) mingw-w64-ucrt-x86_64-winpthreads-git
19) mingw-w64-ucrt-x86_64-winstorecompat-git
然后,gcc
命令仍然无法使用。我相信这与我没有将其添加到 MSYS32 的 PATH
有关,但是没有说明如何执行此操作(而且即使安装了整个工具链,C:\msys64\mingw64\bin
也是空的!)
此外,他们后来说:
除此之外,请按照 INSTALL.md 中的 Unix / Linux 说明进行操作。
太棒了,所以我去看 INSTALL.md
,但那里只有另一个提示:
$ ./Configure
$ make
$ make test
为什么在Windows上构建和安装OpenSSL如此复杂?我想要官方源码,而不是通过Git或XAMPP或未知的第三方解决方法(他们为什么不提供.exe?)
希望这篇文章能成为未来任何想要在Windows上安装OpenSSL并获得完整指令的人的参考。
谢谢。
Microsoft对第三方软件包不负责任,也不授予任何许可证。
和正在下载https://slproweb.com/download/Win64OpenSSL-3_1_2.msi
- undefined