How to work with a function setTrustedCertificates of SecurityContext in Dart?

Viewed 132

My project using a plugin mqtt_client to connect to the MQTT of a device. To connect MQTT success I had to use a function setTrustedCertificates of SecurityContext to trust a file crt.

My problem here, after setTrustedCertificates the first time and connect MQTT success, the next time If I use setTrustedCertificates to trust a wrong crt, It still connects success without failure. Why is that? Is there a solution to trust a crt more than once? or remove a crt that had been trusted before?

I using Flutter for my project.

Thanks

0 Answers
Related