开发者

How to get a *.cer file to add a self-signed HTTPS certificate as trusted for Java

I'm connecting to a HTTPS website with a self-signed certificate using a Java applet. The applet can't open the HTTPS connection - it returns the following exception:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

So the problem is that I need to add the certificate as "trusted" for Java. I rea开发者_开发技巧d that I should use the following command:

keytool -import -alias abc -file ABCCA.cer

Am I correct? How do I retrieve the *.cer file? The server is running Debian 5. I'm using Windows 7 and Java 6 on the client machine.


Connect to the https server with a browser and export the certificate.

With firefox is is done by double-clicking on the lock in the status bar, clicking on the button "View certificate", then in the "Details" tab, click on "Export..."


Follow below steps

1) In Chrome go to settings.
2) In Settings click show advance settings.
3) Under HTTPS/SSL Click on Manage Certificates.
4) Export Your Certificate.
5) In Windows searchs (Pressing windows key on keyboard) type java.
6) Select (Configure Java) Option Which will open Java Control Panel
7) Select Security tab in Java Control Panel
8) Select Manage Certificates
9) Click Import
10) Under (User) tab selected and certificate type as (Trusted Certificates)
11) Click import button and browse to downloaded certificate and import it.

Done Enjoy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜