Search code examples
javaweb-servicestomcatspring-wsjsse

How to configure Spring Ws with keystore and trustore?


Where do I place these commands in Spring Ws

-Djavax.net.ssl.keyStore=tomcat.keystore
-Djavax.net.ssl.keyStorePassword=tomcat
-Djavax.net.ssl.trustStore=tomcat.keystore
-Djavax.net.ssl.trustStorePassword=tomcat
-Djavax.net.debug=SSL

Do i have to place it as arguments or specify the properties in some class.I have Spring WS annotation based configuration can I configure the properties in the application itself.


Solution

  • I got the solution I can either set the properties using

    System.setproperty("-Djavax.net.debug","SSL");
    

    Or I can specify these arguments with tomcat7 when the server starts running. Go to eclipse->right click on project->click run configuration->select tomcat ->select arguments->paste the property->click apply And then restart tomcat