简体   繁体   English

创建StartSSL证书的信任库

[英]Create truststore for StartSSL Certificate

I'm trying to create a truststore from StartSSL certificates to enable http2 in Wildfly 10. 我正在尝试从StartSSL证书创建信任库,以在Wildfly 10中启用http2。

So far I have tried this script and the instructions in this link . 到目前为止,我已经尝试了此脚本和此链接中的说明。

So I executed the commands below: 所以我执行了以下命令:

wget http://www.startssl.com/certs/ca.cr
keytool -import -trustcacerts -keystore truststore -alias startcom.ca -file ca.crt
wget http://www.startssl.com/certs/sub.class1.server.ca.crt
keytool -import -trustcacerts -keystore truststore -alias startcom.ca.sub.class1 -file sub.class1.server.ca.crt

The first keytool command works ok, but I get get the following error in the last command: 第一个keytool命令工作正常,但是在最后一个命令中出现以下错误:

keytool error: java.lang.Exception: Input not an X.509 certificate

Anyone have any idea what I'm doing wrong? 有人知道我在做什么错吗?

Answer - These are the correct files: 答案 -这些是正确的文件:

wget http://www.startssl.com/certs/ca.cr
keytool -import -trustcacerts -keystore truststore -alias startcom.ca -file ca.crt
wget https://www.startssl.com/certs/ca-g2.crt
keytool -import -trustcacerts -keystore truststore -alias startcom.ca-g2 -file ca-g2.crt
wget https://www.startssl.com/certs/ca-sha2.crt
keytool -import -trustcacerts -keystore truststore -alias startcom.ca-sha2 -file ca-sha2.crt

You are not doing it wrong. 你没有做错。 It is the second file ( sub.class1.server.ca.crt ) which you might have downloaded, is wrong. 这是您可能已下载的第二个文件( sub.class1.server.ca.crt )错误。 Upon inspection, the file had invalid data in it. 经检查,文件中包含无效数据。

You can view this yourself by opening that file in a text editor, you might see this data - class1/sha2/der/sub.class1.server.sha2.ca.crt . 您可以通过在文本编辑器中打开该文件来自己查看此文件,您可能会看到此数据-class1 / sha2 / der / sub.class1.server.sha2.ca.crt

If you need the whole chain, you could grab it from any browser. 如果您需要整个链,则可以从任何浏览器中获取它。 Just click the green lock on the address bar, which will open the native Certificate Viewer, through which you can choose to download individual certificates or the whole chain. 只需单击地址栏上的绿色锁 ,这将打开本机证书查看器,通过它您可以选择下载单个证书或整个链。

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

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