Created
June 11, 2020 05:39
-
-
Save velotiotech/bfd8c10c124abcede872faa44af2cc63 to your computer and use it in GitHub Desktop.
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
$ export PEER_NAME=$(hostname) | |
$ export PRIVATE_IP=$(ip addr show eth0 | grep -Po 'inet \K[\d.]+') | |
$ cfssl print-defaults csr > config.json | |
$ sed -i 's/www\.example\.net/'"$PRIVATE_IP"'/' config.json | |
$ sed -i 's/example\.net/'"$PEER_NAME"'/' config.json | |
$ sed -i '0,/CN/{s/example\.net/'"$PEER_NAME"'/}' config.json | |
$ cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=server config.json | cfssljson -bare server | |
$ cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=peer config.json | cfssljson -bare peer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment