Skip to content

Instantly share code, notes, and snippets.

@karthickvkumar
Forked from arundhaj/certificate.cnf
Created April 18, 2023 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthickvkumar/885fe6e5f3cc8304995edcd6d516d89d to your computer and use it in GitHub Desktop.
Save karthickvkumar/885fe6e5f3cc8304995edcd6d516d89d to your computer and use it in GitHub Desktop.
Using Angular CLI and self-signed SSL Certificate to serve over HTTPS in localhost
[req]
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = IN
ST = India
L = India
O = My Organisation
OU = My Organisational Unit
emailAddress = email@domain.com
CN = localhost
[v3_req]
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout localhost.key -days 3560 -out localhost.crt -config certificate.cnf
@karthickvkumar
Copy link
Author

ng serve --ssl --ssl-cert C:\Arun\angular-https\localhost.crt --ssl-key C:\angular-https\localhost.key

@karthickvkumar
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment