Skip to content

Instantly share code, notes, and snippets.

@Psvensso
Created November 8, 2020 07:29
Show Gist options
  • Save Psvensso/3fd5dfa1f2355d686ffdc4291f5f4307 to your computer and use it in GitHub Desktop.
Save Psvensso/3fd5dfa1f2355d686ffdc4291f5f4307 to your computer and use it in GitHub Desktop.
Create React App - Windows SSL Setup
HTTPS=true
HOST='dev.local.io'
SSL_CRT_FILE=certificate.crt
SSL_KEY_FILE=certificate.key
  1. Modify domain to hosts (C:\Windows\System32\drivers\etc\hosts)
  2. Open GitBash (comes with Git for windows install)
  3. Create certificate.conf file and project root
  4. Run OpenSSL command to generate .crt and .key (generate-files.sh)
  5. Install certificate on local machine In Windows open the start menu and type "certificates". Select "Manage Computer Certificates" Expand "Trusted Root Ceritification Authorities" Right click on "Certificates" and select "All Tasks" -> "Import". Click next Enter the path for the crt file. next next next to import the certificate
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = GB # Enter 2 digit country code here
O = My Company # Enter company name
CN = dev.local.io
[v3_req]
keyUsage = critical, digitalSignature, keyAgreement
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = dev.local.io
openssl req -x509 -newkey rsa:4096 -sha256 -keyout certificate.key -out certificate.crt -days 365 -config certificate.conf -new -nodes
127.0.0.1 dev.local.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment