Created
December 12, 2017 22:32
-
-
Save lucymtc/78306981bce5f04e4b362546b53939e8 to your computer and use it in GitHub Desktop.
Creating CA-Signed Certificates for Dev Sites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run in the Terminal | |
| ----------------------------------------------- | |
| $ openssl genrsa -out mysite.dev.key 2048 | |
| $ openssl req -new -key mysite.dev.key -out mysite.dev.csr | |
| ----------------------------------------------- | |
| Answer questions after this last command | |
| Then: | |
| Create a mysite.dev.ext | |
| And copy the following. | |
| ----------------------------------------------- | |
| authorityKeyIdentifier=keyid,issuer | |
| basicConstraints=CA:FALSE | |
| keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment | |
| subjectAltName = @alt_names | |
| [alt_names] | |
| DNS.1 = mysite.dev | |
| DNS.2 = mysite.dev.192.168.1.19.xip.io | |
| ----------------------------------------------- | |
| // Run in the Terminal | |
| ----------------------------------------------- | |
| openssl x509 -req -in mysite.dev.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial \ | |
| -out mysite.dev.crt -days 1825 -sha256 -extfile mysite.dev.ext | |
| ----------------------------------------------- | |
| Paste private key pass phrase | |
| with VVV: | |
| $ vagrant ssh | |
| $ cd /etc/nginx/custom-sites && ls -ahl | |
| $ sudo nano mysite.conf | |
| Paste at the end, before closing brackets, (also out of ssh paste in vagrant/config/nginx-config/sites/mysite.conf): | |
| ----------------------------------------------- | |
| ssl on; | |
| ssl_certificate /srv/config/nginx-config/sites/ssl/mysite.dev.crt; | |
| ssl_certificate_key /srv/config/nginx-config/sites/ssl/mysite.dev.key; | |
| ----------------------------------------------- | |
| Then Run: | |
| $ sudo service nginx reload | |
| DONE! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment