SSL certificate problem in a web service proxy

前端 未结 3 2024
梦毁少年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条回答
  •  梦毁少年i
    2021-01-22 15:35

    You mean your web service is protected with a "client certificate"? If yes, get the certificate in either a .p12 (PFX) or keystore format from the service provider and use the following System properties to set it before your call:

    javax.net.ssl.keyStore - Path to the keystore on your server

    javax.net.ssl.keyStorePassword - passphrase for that keystore

    javax.net.ssl.keyStoreType - Set it to "pkcs12" is the client certificate provided to you is .p12

    If you application is client to only one web service provider, set these properties as VM arguments, if not, you may need to create specific SSLConnectionFactory for each secured endpoint. Refer to my response on this post for details on creating custom SSL Socket Factories.

提交回复
热议问题