I have a question about how and what is the version of OpenSSl that I must install in Windows to later create certificates. Install a one version (openssl-1.0.2d-fips-2.0.10) found in SourceForge but it does not generate the files correctly. There is also the official website https://www.openssl.org, but I do not know how to install it and how, so that when it comes to generating the keys and .pem file, it works. Generate some environment variables that point to the folder where I unzipped the downloaded, I do not know if it is the correct way.


当前回答

这里有一个解决方案,可能会让那些已经实现了WSL (Windows Subsystem for Linux)的人感到高兴。你可以用:

WSL openssl…

关键是许多实现了WSL的人可能没有意识到他们可以通过这种方式从DOS或powershell命令行调用任何linux命令(在他们的底层WSL linux虚拟机中)。(人们很容易认为WSL的目的是用它来“shell到vm”,这确实是一个选项,但是从Windows运行linux命令的能力是WSL真正的增值。)

需要明确的是,在执行上面的命令时,您可能指向(或创建)的任何文件名或文件夹都将相对于您运行命令的Windows文件夹。例如,openssl req创建一个自签名证书,其中可以将-keyout命名为selfsigned。输入自签名。crt,这两个文件将被创建在运行命令的Windows文件夹中。

也就是说,对于一些openssl命令示例来说,这可能会失败,例如,如果他们试图使用各种特定于bash的参数,在这种情况下,“shell到wsl”来运行命令可能是更好的选择。您仍然可以直接在主机上找到或放置东西,但我并不是说这个答案过于关注WSL方面。我只是想把它作为安装openssl的另一种选择。

其他回答

如果你已经安装了chocolatey,你可以通过一个命令来安装openssl。

choco install openssl

你可以从这里获取https://slproweb.com/products/Win32OpenSSL.html

得到https://wiki.openssl.org/index.php/Binaries的支持和认可

安装铲斗,然后打字

scoop install openssl

你安装Git了吗? 您可以在Git Bash中访问openssl命令,而无需添加任何环境变量。

但是,如果你想从Windows cmd中访问openssl命令,请跟随我:

找到Git bin目录的路径。通常是在

C:\Program Files\Git\usr\bin\

然后添加路径你的环境变量(User变量-> path):

现在打开一个新的命令提示符(不要使用已经打开的cmd,因为已经打开的cmd不知道新的环境变量)。

现在写:

openssl

我从https://slproweb.com/products/Win32OpenSSL.html安装了openssl 3.0.0。然后我进入windows start ->openssl->Win64 openssl命令提示符,它会打开一个像常规dos窗口一样的窗口,我所需要的就是进入openssl的安装文件夹。