SSL certificate problem in a web service proxy

前端 未结 3 2023
梦毁少年i
梦毁少年i 2021-01-22 15:12

I am building a JAVA web service client in which i connect to a service.

This service has a ssl certificate verification.

How to call this service using ssl cert

3条回答
  •  无人及你
    2021-01-22 15:48

    I am able to do the web service connection...

    I added the key store using the command:

    keytool -import -trustcacerts -file  -alias  -keystore  
    

    gave the password as "changeit" and added the certificate in keystore.

    Now in code i added two lines:

    System.setProperty("javax.net.ssl.trustStore", "/jre/lib/security/cacerts");
    System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
    

    also added

    _call.setUsername("username");
    _call.setPassword("password"); 
    

    where _call is the call object of Call Class.

    And it worked!!!!!!

提交回复
热议问题