Open hchautrung opened 4 days ago
you are missing aedes.handle part in your code
@robertsLando its included const mqtt_server = tls.createServer(tls_options, aedes.handle)
. It works fine on localhost with a self singed certificate without Nginx
Sorry missed that line, anyway I have no clue how to help here, for sure it's a misconfiguration on nginx or you are creating certificates wrongly
Hi removed ssl and cert part in the nginx config and it works, I quite not understand.
stream {
log_format basic '$proxy_protocol_addr - $remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time "$upstream_addr"';
access_log /var/www/llos-mqtt.unimetaverse.net/logs/stream.log basic;
error_log /var/www/llos-mqtt.unimetaverse.net/logs/stream-error.log;
upstream backend {
hash $remote_addr consistent;
server 192.168.98.56:8883; # Your actual MQTT broker address and port
}
server {
listen 8883;
proxy_connect_timeout 1s;
proxy_timeout 10m; # is default
proxy_pass backend;
}
}
Hi all,
I want to implement MQTT over TLS using generated Let's Encrypt of domain mqtt.llos.unimetaverse.net.
Note:
fullchain.pem
is generated by Let's Encrypt only contains intermediate cert and certificate only, not including root-ca certificate.def connect_llos(): client = paho_mqtt.Client(paho_mqtt.CallbackAPIVersion.VERSION2, CLIENT_ID) client.username_pw_set("", "") client.tls_set(ca_certs=PATH_TO_LLOS_ROOT_CA, keyfile=PATH_TO_LLOS_PRIVATE_KEY, certfile=PATH_TO_LLOS_CERTIFICATE, cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2)
client.tls_insecure_set(True)
def main(): client = connect_llos()
$ curl -o isrgrootx1.pem https://letsencrypt.org/certs/isrgrootx1.pem $ cp fullchain.pem root_fullchain.pem $ cat isrgrootx1.pem >> root_fullchain.pem