Need Help connecting Arduino Uno Wifi Rev 2 via TLS to MQTT Broker

Hi everyone,

I am having trouble connecting my Uno Rev 2 securely to my MQTT Broker.

I've had a code where I've successfully connected the Arduino to a different broker but on a not-secured connection. There I have used the WiFiNINA and the PubSubClient libraries.

Since I need the connection to be secured, I've retrieved the CA Certificate, the Client Certificate and the Client Key but don't really know how I should handle them and what library I am able to use.
I know that the Wifi Module on the Uno Rev 2 is ESP32 based, but I could not get WiFiClientSecure, WiFiSSLClient,... running.

I'd greatly appreciate some help with this!

I am having trouble connecting my Uno Rev 2

Are you absolutely sure you have an UNO Rev 2 and not an UNO WiFi Rev 2? Despite the name that are two completely different boards having almost nothing (other than the form factor) in common.
Naming that board UNO is probably the most stupid thing Arduino has done since they were founded.

To my knowledge no actual UNO Rev 2 was publicly available, they only sold Rev 3.

Hi pylon,

Yes indeed, I do mean the Arduino UNO WiFi Rev 2. Sorry for not clearly displaying that.

After researching a bit more I could not find one example, where someone was trying to connect an Uno WiFi Rev 2 to a MQTT Broker via TLS/SSL.

Seems like there is no library that supports this service on this board as of right now. Please, feel free to educate me if I am wrong.

The WiFiNINA library support a connectSSL() method that you may use for your purpose. It probably only works if the server is using a certificate of one of the big CAs, I couldn’t find any information about which CAs are preloaded on the module.

The IDE can upload root certs to the WiFiNINA module. In the IDE run Tools | WiFi101/WiFiNINA Firmware Updater

The bottom section is titled "Update SSL root certificates".


unfortunately, the Firm Updater does not work for me, since I've received the certificates directly from the IoT Platform I am trying to connect to.
I am not able to add a domain, because the certificate was generated by the platform. However I did transfer the certificates onto my Laptop.

Isn't there a workaround/alternative to upload the certificates?

Can the computer running the Arduino firmware updater connect to the IOT domain
with a web brower? If so, the firmware updater should be able to connect the
domain and download the certs. If the domain is not accessible, how can the
Arduino board use it?

After adding the certificate using the firmware update tool, is there anything else that needs to be done before the site can be connected to using connectSSL()?