最近,我尝试调用一个JAX-WS Web服务。但是我遇到了一个SSL配置异常问题。因此,我获取了与WSDL相关的两个证书cert1.cer和cer2.cer,并像这样将它们集成到cacerts中:
1. Place the below cry certificates in the path "C:\Program Files\IBM\SDP\jdk\jre\lib\security"
cert1.cer, cert2.cer
2. cacerts is the trusStore file. It's present in :
C:/Program Files/IBM/SDP/jdk/jre/lib/security/cacerts
3. In command prompt perform the below execution
C:\Program Files\IBM\SDP\jdk\jre\lib\security>"C:\Program Files\IBM\SDP\jdk\jre\bin\keytool" -import -alias cert1 -file cert1.cer -keystore cacerts
4. If it asks keystore password, mention changeit, which is the default keystore password
Enter keystore password: changeit
Trust this certificate? [no]: yes
Certificate was added to keystore
5. Peform the steps 3 and 4 for the second certificate(cert2.cer).
但我不明白如何通过Java编程来复制上述过程。我想从我的Java类中进行操作,而不是在DOS中手动执行。有人可以给我一些指导吗?
非常感谢任何帮助。