简体   繁体   English

Windows Tomcat7 SSL CA证书说是自签名的

[英]Windows Tomcat7 SSL CA cert says is self signed

Hi I'm trying to configure tomcat7 (7.0.50) in windows 7 using a cert from a CA (entrust, if it matters). 嗨,我正在尝试使用来自CA的证书在Windows 7中配置tomcat7(7.0.50)(信任,如果有关系的话)。 I downloaded the CA root, chain root and chain cert files, and my new certificate. 我下载了CA根目录,链根和链证书文件以及新证书。 Per the tomcat guide , I used the keystore I generated the csr from and followed these steps 根据tomcat指南 ,我使用了从中生成csr的密钥库,并按照以下步骤进行操作

  1. keytool -import -alias entrust -trustcacerts -keystore crush.jks -file entrust.crt.txt 密钥工具-导入-别名委托-trustcacerts-密钥库美眉.jks-文件entrust.crt.txt

[prompts me the cert exists in the system wide CA keystore, I still add it] [提示我该证书存在于系统范围的CA密钥库中,但我仍将其添加]

  1. keytool -import -alias chain-root -trustcacerts -keystore crush.jks -file L1Kchainroot.txt keytool-导入-别名链根-trustcacerts -keystorerush.jks-文件L1Kchainroot.txt

  2. keytool -import -alias chain-root -trustcacerts -keystore crush.jks -file L1Kchain.txt keytool-导入-别名链根-trustcacerts -keystorerush.jks-文件L1Kchain.txt

  3. keytool -import -alias tomcat -trustcacerts -keystore crush.jks -file entrustcert.crt.txt keytool-导入-alias tomcat -trustcacerts -keystorerush.jks-文件entrustcert.crt.txt

Now when I list the contents of my keystore I see 现在,当我列出密钥库的内容时,我看到

C:\Users\crush\My Documents\cert>keytool -list -keystore crush.jks
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 5 entries

entrust, Mar 30, 2015, trustedCertEntry,   
Certificate fingerprint (SHA1): B3:1E:B1:B7:40:E3:6C:84:02:DA:DC:3

chain, Mar 30, 2015, trustedCertEntry,   
Certificate fingerprint (SHA1): CC:A2:7D:33:C7:35:A7:D0:6D:1F:EC:A

chain-root, Mar 30, 2015, trustedCertEntry,   
Certificate fingerprint (SHA1): 9E:1A:0C:35:E7:14:B6:97:92:D0:90:B

tomcat, Mar 30, 2015, trustedCertEntry,   
Certificate fingerprint (SHA1): 6A:77:EC:32:1E:F9:AC:4F:BE:C7:CB:5

crush-windows7, Mar 26, 2015, PrivateKeyEntry,   
Certificate fingerprint (SHA1): 04:72:8A:36:56:7E:D5:0F:7E:E9:E0:1

Now I edited my server.xml file to be like so 现在,我编辑了server.xml文件,如下所示

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" 
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" sslEnabledProtocols="TLSv1" 
    keystoreFile="C:\Users\crush\apache-tomcat-7.0.50\conf\crush.jks"  
    keystorePass="storepassword" 
    keyPass="keypassword"
/>

When this boots up and I navigate to the page I'll see an untrusted connection warning 启动后,我导航到该页面,我将看到不可信的连接警告

crush-windows7.crush.com:8443 uses an invalid security certificate. The certificate is not trusted because it is self-signed. (Error code: sec_error_ca_cert_invalid)

If I use -v with keytool and inspect the returned certificate I'll see the Issuer as Entrust 如果我将-v与keytool一起使用并检查返回的证书,我会看到Issuer为Entrust

Owner: CN=crush-windows7.crush.com, ....
Issuer: CN=Entrust Certification Authority - L1K, OU="(c) 2012 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US

But my private key entry has the issuer as myself 但是我的私钥条目将发行人作为我自己

Owner: CN=crush-windows7.crush.com, ....
Issuer: CN=crush-windows7.crush.com, ....

I've been messing with this for a couple hours and bashing my head against the wall, I've done this with linux before using openssl instead of keytool without issues. 我已经花了几个小时弄乱了我的脑袋,在使用openssl而不是keytool之前,我已经在linux上做到了这一点,而没有出现问题。 Could this be my issue? 这可能是我的问题吗? No matter what connector config I try, it will not boot without the private key entry as the alias and the keyPass option set. 无论我尝试使用哪种连接器配置,如果没有设置私钥条目作为别名和设置keyPass选项,它将无法启动。 If I remove the private key entry it will boot but never complete the ssl handshake. 如果删除私钥项,它将启动,但永远不会完成ssl握手。 I use the 'tomcat' alias for the keyAlias it will say 我对keyAlias使用'tomcat'别名,它会说

java.io.IOException: Alias name tomcat does not identify a key entry

Can I salvage my current certificate or do I need to generate a new private key and csr and submit a new request then move them to my windows machine? 我可以挽救当前的证书,还是需要生成一个新的私钥和csr并提交一个新的请求,然后将其移到Windows机器上? I really feel this is my issue, am I even close to being on point? 我真的觉得这是我的问题,我是否已经接近要点了? Using windows for this has been less than comfortable, thanks for helping. 感谢您的帮助,为此使用窗户并不舒服。

You have made a small mistake in step 4: Instead of updating your PrivateKeyEntry with the certificate issued by Entrust, you have imported it as a trusted certificate. 您在第4步中犯了一个小错误:您没有使用Entrust颁发的证书更新PrivateKeyEntry,而是将其导入为受信任证书。

The right command would have been: 正确的命令应该是:

keytool -import -alias crush-windows7 -trustcacerts -keystore crush.jks -file entrustcert.crt.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM