Created
June 29, 2024 14:56
-
-
Save rbonestell/097f58a38d6a81c128e99af05ab89f72 to your computer and use it in GitHub Desktop.
Create a self-signed SSL certificate for local development and testing
This file contains 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
#!/bin/bash | |
# SSL certificates should have a validity period of less than 398 days | |
# * https://chromium.googlesource.com/chromium/src/+/master/net/docs/certificate_lifetimes.md | |
# * https://support.apple.com/en-us/102028 | |
# Create Private Key | |
openssl genrsa -out key.pem 2048 | |
# Create Certificate Signing Request | |
openssl req -new -sha256 -key key.pem -out csr.csr | |
# Generate Self-Signed Certificate | |
openssl req -x509 -sha256 -days 397 -key key.pem -in csr.csr -out cert.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment