0

We had a webservice that is recently exposed over https.

When we try to connect to it over https using JAX-WS client, it throws following exception com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect Which generally means that the there is some problem over socket connection. It throws exception when we try to call some operation of webservice using webservice client. The http call to the webservice is working fine.

The funny thing here is that this problem only happens when we have deployed the webservice and had made our first call to access operations using https protocol. Now as soon as we make a http call, surprisingly after that even https also starts working.

Please give some advice if some one has faced this kind of issue before.

Harbeer Kadian
  • 364
  • 2
  • 14

1 Answers1

1

In general your java client should have ssl certificate in trusted key store.

Use keytool for certificate management: keytool -import -trustcacerts -keystore trastedCert -storepass traustedCertPassword -noprompt -alias trastedCert -file trastedCert.cer

Your can add trusted cert to your JVM(cacerts):

keytool -import -trustcacerts -keystore cacerts -storepass traustedCertPassword -noprompt -alias trastedCert -file trastedCert.cer

or

For jBoss app server I'm using next JAVA_OPTS params:

set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore=%PATH_TO_CERT%\traustedCert -Djavax.net.ssl.trustStorePassword=traustedCertPassword

Shurok
  • 195
  • 1
  • 9
  • The problem here is not about certificate getting stored, because the https calls starts working fine as soon as i make my first http call – Harbeer Kadian May 14 '13 at 17:03