Last active
March 24, 2025 13:11
-
-
Save segrax/b86afbcf5ec7d1d658c1695d0d3f5967 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
#!/usr/bin/env bash | |
DIR="./etc/" | |
DOMAIN="localhost" | |
PASSPHRASE="" | |
SUBJ=" | |
C=DE | |
ST= | |
O= | |
localityName= | |
commonName=$DOMAIN | |
organizationalUnitName= | |
emailAddress= | |
" | |
mkdir -p "$DIR" | |
openssl genrsa -out "$DIR/server.key" 2048 | |
openssl req -new -subj "$(echo -n "$SUBJ" | tr "\n" "/")" -key "$DIR/server.key" -out "$DIR/server.csr" -passin pass:$PASSPHRASE | |
openssl x509 -req -days 365 -in "$DIR/server.csr" -signkey "$DIR/server.key" -out "$DIR/server.crt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment