I wrote a module that connects to service over https with authentication. After setting proper path to keystore it works fine. There is a problem when I want to use that module (as a jar) in my Tomcat application. I set proper paths (absolute paths) to keystore as well but when I try to connect I get handshake exception
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
As I remember I got this message before when I had incorrect keystore. Do I need to do anything more with that to make it work under Tomcat. Any other issue I missed? I connect to another service over https without authentication and this works fine (in Tomcat app).
edit: The problem was to run a project that connects to different services through ssl (not only in Tomcat). One with authentication, second without. So I edited the title