Created
January 16, 2025 06:50
-
-
Save vastus/026823c062aa6939a402f44dd5f5f1e3 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Usage: | |
# $ sh mkcert example.com | |
set -euo pipefail | |
main() { | |
DOMAIN="$1" | |
local key="${KEY:-$DOMAIN.pem}" | |
local crt="${CRT:-$DOMAIN.crt}" | |
# create self-signed cert | |
openssl req -x509 -noenc -newkey rsa:2048 -keyout "$key" -out "$crt" \ | |
-subj "/C=US/ST=WA/CN=$DOMAIN" | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment