2010-07-07 149 views
2

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

这里是我使用的命令:

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

回答

0

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

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