Using SSL(Secure Socket Layer) in JAX-WS webservice

In this tutorial I will show how to use SSL/TSL or https in JAX-WS webservice. For using SSL with jax-ws webservice we need one keystore file. Please have a look at deploy jax-ws webservice before reading this tutorial.

First generate the keystore file using the below command from the command prompt. D:\keystore is the target location where the keystore file will be generated.


You will be prompted for below options. So put the values.


Configure Tomcat server to support for SSL

Open <tocat home directory>\conf\server.xml file and search for “<Connector port=”8443″ protocol=”HTTP/1.1″ SSLEnabled=”true” …/>”

Uncomment the above line and modify as shown below


For more information on SSL configuration you can have a look at the URL

Now start the Tomcat Server and verify whether SSL connection gets established using https://localhost:8443/ in the browser.

Now test the service


You will get below exceptions in localhost so click on the below exception links to resolve the issues. No name matching localhost found
SunCertPathBuilderException: unable to find valid certification path to requested target

Thanks for your reading. Please leave a comment if you have any query.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.