views:

1860

answers:

2

How do you import an SSL certificate created by java into a project in Eclipse?

A: 

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.

Jon
+3  A: 

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 <provide_an_alias>
    -file <certificate_file>
    -keystore <your_path_to_jre>/lib/security/cacerts

Regards

SourceRebels
Worked for me.FYI, the default password associated with your keystore is "changeit"
Brian Clozel