-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL Letsencrypt #2335
Comments
Hi @jgustavo99 In principle the TLS configuration of 2.3 and 3.1 is very similar. Could you describe at which step do you have an issue exactly? If you can give us the output on emqx, it could be helpful. |
The same problem in v3.1-rc.1. Did exactly what is described in this article, but nothing works - HTTPS dashboard, WSS, TLS.
|
Copying the certificate + key to /etc/emqx/certs/ and chown to emqx:emqx solves the error, but of cause creates an issue with the certbot reissue cycle and possible an issue with the privkey. |
@turtleDeng any progress on this? |
But then what would be the best way to solve the problem? No problems with certificate renewal, etc. |
For renewal, I followed this guide: https://certbot.eff.org/docs/using.html#renewing-certificates and created this post deploy hook. #!/bin/sh
set -e
for domain in $RENEWED_DOMAINS; do
case $domain in
example.com)
daemon_cert_root=/etc/emqx/certs
# Make sure the certificate and private key files are
# never world readable, even just for an instant while
# we're copying them into daemon_cert_root.
umask 077
cp "$RENEWED_LINEAGE/cert.pem" "$daemon_cert_root/cert.pem"
cp "$RENEWED_LINEAGE/privkey.pem" "$daemon_cert_root/key.pem"
cp "$RENEWED_LINEAGE/chain.pem" "$daemon_cert_root/cacert.pem"
# Apply the proper file ownership and permissions for
# the daemon to read its certificate and key.
chown emqx:emqx "$daemon_cert_root/cert.pem" \
"$daemon_cert_root/key.pem" \
"$daemon_cert_root/cacert.pem"
chmod 400 "$daemon_cert_root/cert.pem" \
"$daemon_cert_root/key.pem" \
"$daemon_cert_root/cacert.pem"
service emqx restart >/dev/null
;;
esac
done |
I managed to make it work in a slightly different way. Use the script from @i906 but comment out the line that copies cacert.pem, then in your
|
Still waiting for a simple built-in solution. |
From the Certbot docs: It is OK to: chmod 0755 /etc/letsencrypt/{live,archive}
chgrp emqx /etc/letsencrypt/live/<domain>/privkey.pem
chgrp emqx /etc/letsencrypt/archive/<domain>/privkey1.pem
chmod 0640 /etc/letsencrypt/live/<domain>/privkey.pem
chmod 0640 /etc/letsencrypt/archive/<domain>/privkey1.pem If you will never downgrade to an older version of Certbot. I can confirm that this works on a fresh cert install. My question is: |
Hi. I direct the certificate path to live or archive? Why do we give emqx permissions in the archive folder? Thank you. |
sorry for the super late reply. As for SLL certificate files configuration, I believe this is the answer: |
When should I run this script. And is it possible to create some logic to run it automatically? |
There is no need to restart emqx for certs renewal, emqx relads the files everything 2 minutes or so.
anytime after the new certs are issued.
Do you mean inside emqx? |
Thank you so much, you don’t how helpful this is. |
share my script in case someone may need.
|
Hello!
How can I add the ssl letsencrypt certificate in EMQX (Websocket and MQTT)?
I've already tried using the tutorial: https://medium.com/@emqtt/using-lets-encrypt-certificates-in-emq-b11e0e57efa6
But I did not succeed since the tutorial is from version 2.3,
The text was updated successfully, but these errors were encountered: