• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enable SSL in existing web application when deploying it locally on Tomcat

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created the self signed certificate using java keytool and gave the path of the .keystore file in server.xml file in the conf folder of Tomcat.
I have an existing Web Application where I am using SOAP web services and I have to configure SSL in it.
I added the following code in the web.xml file of the application
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Now redeploying this application on Tomcat I run the URL as
https://localhost:8443/DgSuite/login.html (My application URL)
It opens successfully ,but I am not able to login as it says cannot connect
I also changed the path in WSDL file from localhost:8080 to https://localhost:8443 and i am able to open the wsdl with new URL
But I am not able to further login.I am not getting any error in Tomcat logs or even in the debugger (for firefox).
Kindly help

Also Noticed that in the debugger it says it cannot connect to WSDL saying
"{\"success\": false, \"error\": \"Can not connect to controller at https://localhost:8443/dgcontroller/ControllerConnectorPort?wsdl exception: javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://localhost:8443/dgcontroller/ControllerConnectorPort?wsdl. It failed with: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.\"}"
Thanks
Namrata
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I'm not mistaken, the clients of your SSL-enabled application have to trust your certificate. So if your certificate was from one of the big certificate issuers, the client would recognize it. But it isn't. So the client doesn't recognize it, and it says so. (That's what the error message means.)

That means that you'll have to import the root certificate of your self-signed certificate into the keystore of any client which wants to connect to your site. This would include the browser of anybody who wants to connect, which in your case I think means your copy of Firefox. This has nothing to do with Tomcat, by the way, it's a rule of SSL. By the way I may not have used the correct terminology in my answer -- it's been several years since I had to import the certificate of a host with an unrecognizable certificate.
 
reply
    Bookmark Topic Watch Topic
  • New Topic