1

I am trying to call an API from a self-issued cert site.

constructor(private http: HttpClient) {
    this.http.get('https://sample.com/test').subscribe(() => {
        // Do something
    });
}

But I get the following:

GET https://sample.com/test net::ERR_CERT_AUTHORITY_INVALID

The current workaround is to open https://sample.com/test in another tab and proceed with invalid cert, and refresh my app. Then I am able to continue. However, what I need is to automatically ignore this invalid cert and proceed. Please advise.

1 Answer 1

3

I was having the same issue and tried to bypass this warning in my logic but i could not achieve it. Unless i opened the URL in a new tab and issue and clicked on proceed explicitly, my http calls did not return any response.

Now i use a valid certificate so the issue is not there. What you can do is either

  1. Use server your web application and app on http port. (Not recommended as not secure)

  2. Use valid certificate. (Best solution)

  3. Open a dialog on a screen to ask a user to follow the steps(open the service url a new tab and proceed and reload page) to start using the application.

Hope it helps

Sign up to request clarification or add additional context in comments.

1 Comment

Clicking on the URL of the invalid certificate requests that you accept the risks, and when you do, you are all good and you will not experience the error. On development machines this works, but as given above, always endeavour to use a valid certificate.

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.