[SOLVED] unable to find valid certification path to requested target

Error added: 2014-08-30T10:40:46Z

0 people waiting for the answer...

1 answers found.

Answer 2535 (100.0% helpful)

This is an INSECURE answer. It will make the error go away, but you will be liable to MITM attacks, because you aren't verifying the certificates.

    TrustManager[] trustAllCerts = new TrustManager[]{
      new X509TrustManager() {
        public[] getAcceptedIssuers() {
          return new X509Certificate[0];

        public void checkClientTrusted([] certs,
                                       String authType) {

        public void checkServerTrusted([] certs,
                                       String authType) {

    SSLContext sc = SSLContext.getInstance("SSL");
    sc.init(null, trustAllCerts, new;

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.

Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: