首页 > 解决方案 > OPENSSL 创建根 CA 签名证书

问题描述

我有一个问题想问更了解 SSL 证书的人。我试图为一些应该连接到远程服务器的应用程序创建根 CA 签名证书。这就是我在服务器端所做的:

openssl genrsa -out rootca.pem 4096

openssl req -x509 -new -nodes -key rootca.pem -days 3650 -config certconfig_root.txt -out rootca.crt

openssl genrsa -out privkey.pem 4096

openssl req -new -key privkey.pem -config certconfig_app.txt -out newcert.csr

openssl x509 -req -in newcert.csr -CA rootca.crt -CAkey rootca.pem -CAcreateserial -out newcert.pem -days 3650

openssl pkcs12 -inkey privkey.pem -in newcert.pem -export -out newcert.pfx -passout pass:

openssl pkcs12 -inkey rootca.pem -in rootca.crt -export -out rootca.pfx -passout pass:

然后我将 newcert.pfx & rootca.pfx 移动到 APP 端,并将 rootca.pfx 证书安装到 Windows 的 Root CA 证书容器中。它在 certmgr.msc 中可见

APP端证书通用名newcert.pem按照规范正确设置。

然而 SSL hadshake 失败了。我在这里做错了什么?

标签: openssl

解决方案


推荐阅读