Last active
March 10, 2019 06:20
-
-
Save hoangong/f244ef4617bf530e3d0ee4cd79b878ed to your computer and use it in GitHub Desktop.
generate lnd key with custom dns
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
# do this once for server private key: | |
openssl ecparam -genkey -name prime256v1 -out tls.key | |
# both server and all clients have to use the same cert file tls.cert | |
openssl req -new -sha256 \ | |
-key tls.key \ | |
-subj "/CN=localhost/O=lnd" \ | |
-reqexts SAN \ | |
-config <(cat /etc/ssl/openssl.cnf \ | |
<(printf "\n[SAN]\nsubjectAltName=DNS:localhost,DNS:aaaa,DNS:bbbb,IP:192.168.1.xxx")) \ | |
-out csr.csr | |
openssl req -x509 -sha256 -days 36500 \ | |
-key tls.key \ | |
-in csr.csr -out tls.cert \ | |
-extensions SAN \ | |
-config <(cat /etc/ssl/openssl.cnf \ | |
<(printf "\n[SAN]\nsubjectAltName=DNS:localhost,DNS:aaa,DNS:bbbb,IP:192.168.1.xxx")) | |
openssl x509 -in tls.cert -text -noout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment