How do you import an SSL certificate created by java into a project in Eclipse?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Probably you want to import a "fake" SSL cert in JRE's trustcacerts for avoiding not-a-valid-certificate issues. Isn't it?
As Jon said, you can do the job with keytool:
keytool -import -alias -file -keystore /lib/security/cacerts
Use "changeit" as the default password when asked (thanks Brian Clozel). Ensure to use this runtime at your server or launch configuration.
回答2:
You should probably create the certificate and import it into the default keystore using keytool. I'm not sure what you're trying to do with your application, but it should then be able to use that certificate.
回答3:
We need to import a certificate means we need to use :
keytool -importcert -file -keystore -alias ""
It will ask for a password. Type the password as changeit
Type Password : changeit
finally it will ask need to add {yes/no} :
type yes.
Note: Don't give blank space in location path