Created
June 15, 2018 08:55
-
-
Save prafull01/b8d6b45c511b39e14ff637503f8caa51 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