Closed JoyceBabu closed 8 years ago
Hello there! The file we generate only has the intermediate and the client certificate in it which should generally be enough. What is your usecase where you need the CA cert as well?
I did not realize that the .crt
file contained the Lets Encrypt CA certificate too. Sorry.
To generate fullchain.pem
certificates, failures := client.ObtainCertificate([]string{"example.com"}, b, nil, false)
// ...
fullchain := []byte{}
fullchain = append(fullchain, certificates.Certificate...)
fullchain = append(fullchain, certificates.IssuerCertificate...)
Then
ioutil.WriteFile("cert.pem", certificates.Certificate, 0644)
ioutil.WriteFile("chain.pem", certificates.IssuerCertificate, 0644)
ioutil.WriteFile("fullchain.pem", fullchain, 0644)
ioutil.WriteFile("privkey.pem", certificates.PrivateKey, 0640)
Uh, where does that code go?
Use cases:
ZNC_CERTS_DIR=/home/znc/.znc/certs
mkdir -p $ZNC_CERTS_DIR || exit $?
cp -p /var/letse/$LETSE_USER/certificates/example.com.* $ZNC_CERTS_DIR/ || exit $?
cd $ZNC_CERTS_DIR || exit $?
cat *.key *.crt > znc.pem
cat /etc/ssl/certs/dhparam.pem >> znc.pem
chown znc:znc -R $ZNC_CERTS_DIR || exit 1
# restart znc here (set service to run as znc user)
Examples not using lego:
Related issues:
Used different order for weechat recommended by Glowing Bear's Getting Started, constructing fullchain.pem same way as "where does that code go" above:
RELAY_DOM=example.com
RELAY_CERTS_DIR=/home/weechat/.weechat/certs
# ^ weechat's default location for relay.pem
mkdir -p $RELAY_CERTS_DIR || exit $?
cp -p /var/letse/$LETSE_USER/certificates/example.com.* $RELAY_CERTS_DIR/ || exit $?
cd $RELAY_CERTS_DIR || exit $?
cat $RELAY_DOM.crt $RELAY_DOM.issuer.crt > fullchain.pem
cat fullchain.pem $RELAY_DOM.key > relay.pem
# ^ key last as per Glowing Bear "Getting Started" guide
chown weechat:weechat -R $RELAY_CERTS_DIR || exit 1
# restart weechat here (set service to run as weechat user)
sudo apt install weechat-plugins
--no-connect
such as:
su weechat -
killall weechat
killall weechat-headless
weechat --no-connect
/plugin load relay
/set plugins.autoload "relay"
/relay sslcertkey
/save
/set relay.network.password <see weechat relay password>
/set relay.network.ssl_priorities "NORMAL:-VERS-TLS1.0:-VERS-TLS1.1"
/set relay.network.ssl_dhkey_size 4096
/relay sslcertkey
/relay listrelay
/relay del weechat
/relay sslcertkey
/relay add ssl.weechat 9001
/save
/quit
Remaining concerns:
How can I generate
fullchain.pem
? Why isn't it generated with the other files?