Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
}
like image 340
javatar Avatar asked Mar 15 '26 10:03

javatar


1 Answers

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); }
like image 139
javatar Avatar answered Mar 17 '26 03:03

javatar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!