如何查看和编辑cacerts文件? [英] How to view and edit cacerts file?
问题描述
使用RAD 8.5和WAS 8.5运行时,我的控制台出现异常:
Using RAD 8.5 with WAS 8.5 runtime, I am getting an exception on my console:
The keystore located at "C:\IBM\Websphere85\jdk\jre\lib\security\cacerts" failed to load due to the following error: DerInputStream.getLength(): lengthTag=109, too big..
搜索错误后,我得到了这个 链接 ,建议您编辑文件并删除空白行/多余的字符.
After searching for the error I got this link which suggests to edit the file and remove blank lines/extra characters.
如何编辑文件?我在Windows环境中,文件似乎是base64编码的.
How do I edit the file? I am on windows environment and the file seems to be base64 encoded.
推荐答案
这是一种无需查看或编辑文件即可真正解决此问题的方法.
Here's a way to actually solve this problem without the need to view or edit the file.
默认的keyStore类型为JKS,并且WSKeyStore类将其假定为PKCS12文件,从而引发上述错误.因此,我们需要将cacerts文件转换为.p12格式.
The default keyStore type is JKS and the WSKeyStore class assumes it to be a PKCS12 file which throws the above error. So we need to convert the cacerts file to .p12 format.
在我执行的命令行中使用keytool实用程序:
Using the keytool utility from command line I executed:
C:\IBM\WebSphere85\AppServer\java\bin>keytool -importkeystore ^
-srckeystore C:\IBM\WebSphere85\AppServer\java\jre\lib\security\cacerts ^
-destkeystore C:\IBM\WebSphere85\AppServer\java\jre\lib\security\cacerts.p12 ^
-srcstoretype JKS -deststoretype PKCS12 -srcstorepass changeit -deststorepass changeit -noprompt
给了我一个cacerts.p12
文件,上面的类很容易阅读.
which gave me a cacerts.p12
file which could be easily read by the above class.
参考:
- IBM Error
- Stackoverflow: convert .jks to .p12
这篇关于如何查看和编辑cacerts文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!