Last active
May 3, 2016 13:46
-
-
Save oxyflour/2f454b147fc50cee6e4d4143fa0e20b9 to your computer and use it in GitHub Desktop.
create https authorized certs
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
| # from http://engineering.circle.com/https-authorized-certs-with-node-js/ | |
| # generate ca | |
| wget https://raw.githubusercontent.com/anders94/https-authorized-clients/master/keys/ca.cnf | |
| openssl req -new -x509 -days 9999 -config ca.cnf -keyout ca-key.pem -out ca-crt.pem | |
| # generate private key for server | |
| openssl genrsa -out server-key.pem 4096 | |
| # generate server certificate, remember to update the CN (common name) | |
| wget https://raw.githubusercontent.com/anders94/https-authorized-clients/master/keys/server.cnf | |
| openssl req -new -config server.cnf -key server-key.pem -out server-csr.pem | |
| # sign it | |
| openssl x509 -req -extfile server.cnf -days 999 -passin "pass:password" -in server-csr.pem -CA ca-crt.pem -CAkey ca-key.pem -CAcreateserial -out server-crt.pem | |
| # bundle it into pfx | |
| # from https://nodejs.org/api/tls.html | |
| openssl pkcs12 -export -in server-crt.pem -inkey server-key.pem -certfile ca-crt.pem -out server.pfx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment