Hi all,
We have an app that posts & gets to a site over https. I am using the HttpClient object from Apache. The posting and getting works fine most days but every now and then I get the following error (see below) with:
sun.security.validator.ValidatorException: No trusted certificate found
To fix this I copy the Java trust store (cacerts) to the required directory & then run the keytool command importing the .cer file into the required store and this seems to fix it again for a few days.
The problem is I need to run these steps repeatedly every few days as its seems that the certificate is not trusted every now and then (there is def not a problem with expiry dates)...Any help MUCH appreciated...
org.apache.commons.httpclient.HttpRecoverableException: sun.security.validator.ValidatorException: No trusted certificate found
at org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.handleException(HttpConnection.java:1316)
at org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(HttpConnection.java:1352)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:784)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1817)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:956)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:344)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:174)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:440)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:327)
at com.energis.vcbm.BTInterface.getActuateReport(BTInterface.java:406)
at com.energis.vcbm.ActuatePoller.run(ActuatePoller.java:89)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
at org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(HttpConnection.java:1349)
... 13 more
Caused by: sun.security.validator.ValidatorException: No trusted certificate found
at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:304)
at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:107)
at sun.security.validator.Validator.validate(Validator.java:202)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA6275)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA6275)
... 21 more