尝试为在Tomcat上运行的Web应用程序安装SSL证书。
当我运行此命令时,我收到以下错误:
D:\ jdk1.6.0_30 \ bin> keytool -import -alias root -keystore tomcat2.keystore -trust cacerts -file D:/SSL/gdroot-g2.crt输入密钥库密码:
keytool错误:java.security.cert.CertificateException:无法初始化,ja va.io.IOException:DerInputStream.getLength():lengthTag = 94,太大了。
Trying to install an SSL certificate for a web application that runs on Tomcat.
when I run this command I get the error below:
D:\jdk1.6.0_30\bin>keytool -import -alias root -keystore tomcat2.keystore -trust cacerts -file D:/SSL/gdroot-g2.crt Enter keystore password:
keytool error: java.security.cert.CertificateException: Unable to initialize, ja va.io.IOException: DerInputStream.getLength(): lengthTag=94, too big.
最满意答案
默认情况下,证书具有DER格式
您可以使用参数-rfc导入pem / crt文件
keytool -import -alias root -keystore tomcat2.keystore -trustcacerts -rfc -file D:/SSL/gdroot-g2.crtthe certificate is expected by default having DER format
you can import the pem/crt file with parameter -rfc
keytool -import -alias root -keystore tomcat2.keystore -trustcacerts -rfc -file D:/SSL/gdroot-g2.crt更多推荐
发布评论