让我们加密证书,Python和Windows

cla*_*mus 8 python windows ssl-certificate certutil lets-encrypt

我使用"Let"s Encrypt"将我的Web服务器从HTTP更改为HTTPS ."Web服务器包含一个API,我有一个使用API​​的Python应用程序.

在Linux下一切都很好,但在Windows下我收到这个,当我登录时.

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Run Code Online (Sandbox Code Playgroud)

我的想法是,没有安装SSL证书.

所以我下载了"isrgrootx1.der"并将"lets-encrypt-x1-cross-signed.der"重命名为结尾的"*.cer".

然后我打开了Windows控制台,然后运行:

certutil -addstore "Root" "isrgrootx1.cer".
certutil -addstore "Root" "lets-encrypt-x1-cross-signed.cer".
Run Code Online (Sandbox Code Playgroud)

第二个命令失败,因为它不是根证书.我的问题是:在哪个组中安装了"lets-encrypt-x1-cross-signed.cer"?

jsh*_*sha 0

您不需要将“lets-encrypt-x1-cross-signed.cer”添加到您的 Windows 计算机,因为它只是一个中间证书。而且您也不需要添加“isrgrootx1.cer”,因为 Let's Encrypt 证书链已包含在 Windows 中的“DST Root X3”。

您的 Web 服务器很可能未配置为发送中间证书。例如,如果您使用 Certbot,您将需要使用“fullchain.pem”而不是“cert.pem”来配置您的 Web 服务器。