You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ashish Kulkarni <as...@gmail.com> on 2011/09/09 21:25:00 UTC

calling HTTPS URL from tomcat in eclipse fails with unable to find valid certification path to requested target Error

Hello

I have an web application which i am running in tomcat in eclipse, this web
application calls a Web Service to get data, recently we moved these Web
services to use HTTPS, but when i try to call this HTTPS URL from web
service i get following error

I have created a key store, added it to tomcat and then added this
certificate to this key store in tomcat, but it is not working

Any ideas, about how can i get this certificate imported in tomcat, or do i
have to import it in java, how do i do it

Caused by: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
at
sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
at sun.security.validator.Validator.validate(Validator.java:203)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:841)
... 68 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
at
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)


-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com

Re: calling HTTPS URL from tomcat in eclipse fails with unable to find valid certification path to requested target Error

Posted by Ashish Kulkarni <as...@gmail.com>.
Hi
It worked, i added following lines in tomcat configuration

-Djavax.net.ssl.trustStore=C://mypath_to_keystore/keys.jks


Ashish


On Fri, Sep 9, 2011 at 3:25 PM, Ashish Kulkarni <ashish.kulkarni13@gmail.com
> wrote:

> Hello
>
> I have an web application which i am running in tomcat in eclipse, this web
> application calls a Web Service to get data, recently we moved these Web
> services to use HTTPS, but when i try to call this HTTPS URL from web
> service i get following error
>
> I have created a key store, added it to tomcat and then added this
> certificate to this key store in tomcat, but it is not working
>
> Any ideas, about how can i get this certificate imported in tomcat, or do i
> have to import it in java, how do i do it
>
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>  at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
> at
> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
>  at sun.security.validator.Validator.validate(Validator.java:203)
> at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
>  at
> com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
> at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:841)
>  ... 68 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>  at
> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
>  at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
>
>
> --
> Ashish
> www.ayurwellness.com
> www.mysoftwareneeds.com
>



-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com