Support Article

How to install certificates for REST services

SA-2583

Summary



The requirement is to consume REST services in the project, and there is SSL for those services.
User need to have to install Certificates(Keystores and Truststores), but unable to find the exact location to install.

Error Messages



"UnAuthenticated Error."


Steps to Reproduce



Consume REST service which has SSL configured.
ry to get the response.
You will see UnAuthenticated Error.

 

Resolution


Provided the below suggestions:

1.To make a certificate trusted by a JDK, it has to added to JRE's trust keystore.
2.To view the trusted certificate list, go to JRE's security folder (jre1.6.0_06\lib\security) and issue following command: keytool -list -keystore cacerts

3.To add a certificate in this list: keytool -import -alias mycert -keystore cacerts -file d:\mycert.cer.

4.The default password for cacerts is changeit.
 

One can setup both keystore and truststore via JVM arguments. This should help to accomplish two-way SSL.

-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks

-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks

-Djavax.net.ssl.keyStorePassword=<keystore_password>

 

Published January 31, 2016 - Updated October 8, 2020


50% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.