Linux中的keytool导入证书java.util.IllegalFormatConversionException [英] keytool import certificate java.util.IllegalFormatConversionException in linux
问题描述
我正在尝试创建要在tomcat中使用的密钥库,但是使用keytool却收到错误"java.util.IllegalFormatConversionException:d!= java.lang.String".这仅在linux(centos7)中发生,而在Windows中不发生. 我用
I am tring to create a keystore to be used in tomcat but I get the error "java.util.IllegalFormatConversionException: d != java.lang.String" using keytool. This happens only in linux (centos7) but not in windows. I created the keystore with
keytool -genkey -keyalg RSA -alias client -keystore testkeystore -storepass mypassword -validity 3650
并尝试使用
keytool -import -alias arubaauth -trustcacerts -keystore testkeystore -file root_autenticazione_ATe.cer
相同的命令和相同的证书在Windows中不会显示任何错误.
The same commands and the same certificate do not show any error in windows.
怎么了?
预先感谢
推荐答案
我认为问题出在Java 8.151和Java 9中包含的Keytool版本.尝试降级您的JDK环境
I think the problem comes from the Keytool version included in Java 8.151 and Java 9. Older versions are working correctly for me. Try downgrading your JDK environement
进一步的研究使我意识到,仅某些语言在最后一个Java版本中出现问题.因此,通过添加参数-J-Duser.language=en
来强制使用英语的keytool
输出语言来解决该问题就足够了.
further investigation make me realize the problem on last java versions occurs only for some languages. Hence it is enough to force the output language of keytool
in english to solve the problem by adding the parameter -J-Duser.language=en
.
tomcat的默认语言可能不同于英语. 尝试运行以下命令:
Probably the tomcat default language is different than english. try running this command:
keytool -J-Duser.language=en -import -alias arubaauth -trustcacerts -keystore testkeystore -file root_autenticazione_ATe.cer
这篇关于Linux中的keytool导入证书java.util.IllegalFormatConversionException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!