Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing SSL Certificate into Eclipse

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

like image 353
MahlerFive Avatar asked Mar 26 '09 00:03

MahlerFive


People also ask

How do I Import the SSL certificate?

Right-click on the certificate you want to backup and select ALL TASKS > Import. Follow the certificate import wizard to import your primary certificate from the . pfx file. When prompted, choose to automatically place the certificates in the certificate stores based on the type of the certificate.


2 Answers

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 

Use "changeit" as the default password when asked (thanks Brian Clozel). Ensure to use this runtime at your server or launch configuration.

like image 200
sourcerebels Avatar answered Oct 09 '22 06:10

sourcerebels


In case you have the certificate already in your Windows' certificate store (this is common in company deployments with MITM certificates), you can also use the following steps (with help from another Stackoverflow answer with more detailed explaination):

  1. Locate the eclipse.ini file in your Eclipse installation and open it

  2. Below the line -vmargs, add the following lines, then save the file:

-Djavax.net.ssl.trustStore=NUL -Djavax.net.ssl.trustStoreType=Windows-ROOT  
  1. Restart eclipse.
like image 37
Christian Stadelmann Avatar answered Oct 09 '22 05:10

Christian Stadelmann