1

I have certificated my angular app to run over https by adding

ssl: true, 
sslKey: key, 
sslCrt: crt 

to my angular.json and I run via

ng serve --ssl --host: 0.0.0.0

It works fine on https://localhost:4200

Problem is that it throws this error on the browser:

Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ''

I haven't been able to find a solution.

It seems that I am making the API calls to my services via http like:

http://localhost/api/...

where I should make it https://localhost/api/... ?

If that is the case, how can I do this via nodejs, express and mongodb?

If that is not the case, what is?

1 Answer 1

1

Files, libraries and other requests are being called with http and this is bad, when you install an SSL certificate you must call all urls (files, libraries and other requests, etc.) with https to make it work properly.

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

2 Comments

Hello and thanks for your answer! You mean that I need to make the api calls via https?
Yes. When a project has an SSL certificate, there can be no security hole, everything must be in https. I say this from experience, I changed a web project from http to https.

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.