Hi.
Did you manage to get the device working on 5.x firmware?
I am struggling with a similar problem, trying to connect to an Azure IOT Hub.
No matter what I try, CA certificates or SAS tokens, nothing ever happens.
I even tried copying a working node-red setup including certificates, from a gateway running an older version of the firmware.
Regards,
Kim.