3

I'm trying to do a simple post to a server that implement https:

 constructor(private http: HTTP) { }
 this.http.post('https://server/someEndpoint', {}, {'Content-Type':'application/json'})
.then(data => {
          alert(data);
          
        })
 .catch(error => {
         
          console.log(error.status);
          console.log(error); // error message as string
          console.log(error.headers);

        });

Unfortunately I receive the following error “TLS connection could not be established: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.”

I found only one thread getting this error but I don't understand what should I do to fix this error.

Someone can give me some instruction to make a post to a https resource?

thanks

1
  • Did you a find a solution? I am facing the same problem. Commented Jun 7, 2023 at 12:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.