Skip to content

Instantly share code, notes, and snippets.

@wmathes
Last active February 7, 2019 07:26
Show Gist options
  • Save wmathes/db7524f083e89167111079ff9778330c to your computer and use it in GitHub Desktop.
Save wmathes/db7524f083e89167111079ff9778330c to your computer and use it in GitHub Desktop.

Simple Self Signed SSL certifcate (on Win10)

Install openssl for windows

  1. install openssl for windows http://gnuwin32.sourceforge.net/packages/openssl.htm
  2. configure cmd environment. OPENSSL_CONF should point to config file. Usually C:\Program Files (x86)\GnuWin32\share\openssl.cnf.
  3. add C:\Program Files (x86)\GnuWin32\bin to PATH. Run where openssl in cmd to verify it finds the correct file.

Generate your certificate

  1. Edit the config file at OPENSSL_CONF to include your locally signed domain names.
[SAN]
subjectAltName=DNS:*.local,DNS:*.docker,DNS:*.dev.next.sc
  1. generate root certificate and key by running
openssl.exe req -x509 -nodes -days 365 -newkey rsa:2048 -reqexts SAN -extensions SAN -keyout server.key -out server.crt
  1. generate p7k certificate by running
openssl crl2pkcs7 -nocrl -certfile server.crt -out certificate.p7b
  1. add p7k to root certificate store
certutil -enterprise -f -v -AddStore "Root" certificate.p7b

Usage

  1. use server.key and server.crt on your local webserver

  2. add to your hosts file C:\Windows\System32\drivers\etc\hosts

127.0.0.1 	auth-ui.dev.next.sc
127.0.0.1 	auth-restful.dev.next.sc
127.0.0.1 	signage-ui.dev.next.sc
127.0.0.1 	signage-graphql.dev.next.sc
127.0.0.1 	lambda.dev.next.sc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment