# MQTT - TLS encryption example

**URL:** <https://discourse.nodered.org/t/mqtt-tls-encryption-example/17691>\
**Category:** Share Your Projects\
**Tags:** security\
**Created:** [8 November 2019 21:47 UTC](https://discourse.nodered.org/t/mqtt-tls-encryption-example/17691 "2019-11-08T21:47:17Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 November 2019 20:40 UTC](https://discourse.nodered.org/t/mqtt-tls-encryption-example/17691/18 "2019-11-09T20:40:40Z")

</div>

Just updated the first post to include @TotallyInformation's comments;

```auto
# Local MQTT
listener 1883

# Secure MQTT
listener 8883
## This is standard and should always be this
cafile /etc/ssl/certs/DST_Root_CA_X3.pem
## These are from your installation of LE
certfile /home/pi/.node-red/certs/fullchain.pem
keyfile /home/pi/.node-red/certs/privkey.pem
## Forces use of modern version of TLS to avoid security issues
tls_version tlsv1.2
## Force all clients in this listener to provide a valid certificate, change the node config to allow this from NR
#require_certificate true

```

---

_[View the full topic](https://discourse.nodered.org/t/mqtt-tls-encryption-example/17691)._
