Reputation: 161
I am confused about SSL certificates in express js and angular.
I would like to make an angular registration system, which in turn will request resources from an api in express js.
The question is as follows:
Should I use ssl certificates in angular server, and in express js server, or only in angular?
Both the express server and the angular server will be on the same machine, and I need communications between users and the server to be secure.
Upvotes: 0
Views: 158
Reputation: 429
Welcome to Stack Overflow. I would recommend using 2 SSL Certificates one for the angular application and one for the API if setting the applications separately or the API will be used by other applications as well. This is because you have two separate apps that need to use HTTPS, under different domains. I would also recommend putting the applications behind a reverse proxy like Nginx or Apache HAProxy.
If you use a reverse proxy you can do some advanced configuration to use 1 SSL Certificate. There are plenty of tutorials on the web of setting up Nginx for Node. I would check those out.
Upvotes: 1