问题记录-使用jdk的keytool访问无密码证书提示必须输入密码

在安装elasticsearch时,生成http.p12证书后,通过以下命令查看该证书信息时

keytool -keystore config/http.p12 -list

提示:

Enter keystore password:

由于我生成该证书时未设置密码,所以我直接回车,结果输出了以下提示:

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

Keystore type: PKCS12
Keystore provider: SUN

Your keystore contains 1 entry

http, Feb 22, 2023, PrivateKeyEntry, 
Certificate chain length: 0

后在elastic的官网找到了解决方法

https://discuss.elastic.co/t/elastic-ssl-certificate-api/159779/3

大致意思是使用jdk的keytool访问无密码的证书,需要加上在命令中加上

-storepass ""

例如:

keytool -keystore config/http.p12 -list -storepass ""

不加参数,等回车后提示输入密码时,直接回车不会当成无密码处理的

你可能感兴趣的:(java)