Search code examples
jbossserviceejb-3.0jsse

How to include jssecacert (cacert) in client jar file during client calling https wsdl


I have a jar that must be imported in the client application and enable the client to call my https wsdl web service with the help of the imported jar.

I see that when https service must be called, it must be a valid cacert file in the security folder of < java_home > location.

However I cannot make it possible to install the cacert file into clients javahome security folder just by only importing the jar to client's application.

If you have an idea about how to achieve this, any help would be appriciated, thanks in advance.

EDIT [SOLVED]:

I have solved my problem by adding this method just before the service call

public static void trustStore() {
    Properties systemProps = System.getProperties();
    systemProps.put("javax.net.ssl.trustStore","jssecacerts");
    System.setProperties(systemProps);
}

Solution

  • EDIT [SOLVED]: I have solved my problem by adding this method just before the service call

    public static void trustStore() { Properties systemProps = System.getProperties();
    
    systemProps.put("javax.net.ssl.trustStore","jssecacerts");    
    System.setProperties(systemProps); }