I want to run my angular (7+) project with ssl certificate on localhost ( https://localhost:4200).
I tried the following from this link source - Get angular-cli to ng serve over HTTPS:
1) angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"projects": {
"<PROJECT-NAME>": {
"architect": {
"serve: {
"options": {
"sslKey": "<relative path from angular.json>/server.key",
"sslCert": "<relative path from angular.json>/server.crt",
...
}, ...
}, ...
}, ...
}, ...
}, ...
}
2) browser-sync
ng serve --ssl true --ssl-key /node_modules/browser-sync/lib/server/certs/server.key --ssl-cert /node_modules/browser-sync/lib/server/certs/server.crt
When I am running: ng serve--ssl
I am getting this log:
** Angular Live Development Server is listening on localhost:4200, open your browser on https://localhost:4200/ **
In browser