创建 SSL 证书时遇到问题

发布于 2024-09-08 05:10:09 字数 1075 浏览 0 评论 0原文

我正在尝试使用 certutil 为运行 Sun Webserver 6.1 的测试 Web 服务器创建自签名证书。如果有人有更好的使用 Sun Webserver 的说明,我愿意使用 keytool 或 openssl。

以下是我使用的命令:

certutil -S -P "https-myWebapp-" -d . -n myCA -s "CN=myWebserver.com CA,OU=myCompany,C=US" -x -t "CT,CT,CT" -m 102 -v 301 -5

我选择选项 5 - SSL CA,并对关键扩展问题选择“是”。 CA创建成功。现在我已经创建了证书颁发机构,我尝试使用以下命令签署实际证书:

certutil -S -P "https-myWebapp-" -d . -n myServer -s "CN=myWebserver.com,C=US" -c myCA -t "u,u,u"  -m 102 -v 300 -5

在 certutil 提示符下,我选择选项 1 创建启用了关键扩展的 SSL 服务器。这会产生以下错误:

certutil: could not obtain certificate from file: You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert.

我做错了什么?我认为我的 SSL 证书可能失败,但在运行 certutil -L -d 时收到以下信息。 -P“https-myWebapp-”

Certificate Nickname                                      Trust Attributes
                                                          SSL,S/MIME,JAR/XPI
myCA                                                      CTu,Cu,Cu

I'm trying to create a self-signed certificate for a test web server running Sun Webserver 6.1 using certutil. I am open to using keytool or openssl if someone has better instructions which work with Sun Webserver.

Here are the commands that I use:

certutil -S -P "https-myWebapp-" -d . -n myCA -s "CN=myWebserver.com CA,OU=myCompany,C=US" -x -t "CT,CT,CT" -m 102 -v 301 -5

and I select option 5 - SSL CA and "yes" to the critical extension question. The CA is created successfully. Now that I have created the certificate authority, I try to sign the actual cert with the following command:

certutil -S -P "https-myWebapp-" -d . -n myServer -s "CN=myWebserver.com,C=US" -c myCA -t "u,u,u"  -m 102 -v 300 -5

At the certutil prompt, I select option 1 to create a SSL server with critical extensions enabled. This produces the following error:

certutil: could not obtain certificate from file: You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert.

What did I do wrong? I think that I may have a failed SSL certificate, but I get the following when running certutil -L -d . -P "https-myWebapp-"

Certificate Nickname                                      Trust Attributes
                                                          SSL,S/MIME,JAR/XPI
myCA                                                      CTu,Cu,Cu

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

为你拒绝所有暧昧 2024-09-15 05:10:09

在第二个命令中,我需要将 -m 属性更改为新的序列 ID 号。

这修复了错误消息并创建了证书。

In the second command, I needed to change the -m property to a new serial id number.

That fixed the error message and created the certificate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文