[Solved] How detect received message in DTLS?

In nonblocking operation, you typically have a point in the program where it waits for any of the nonblocking file descriptors to report availability of data. In the example you linked, that’s the select(…) line. In practice, you either have such a central select yourself, or have the main loop run by another library to … Read more

[Solved] Error SSL/TLS connection in MQTT with mosquitto broker

I just solved the issue.The problem was that mosquitto was not capable of reading the files not because of permission issues but because of the filepaths. So the thing was that when defining the filepaths in the mosquitto.conf I had to use: cafile /etc/mosquitto/ca_certificates/ca.crt certfile /etc/mosquitto/certs/server.crt keyfile /etc/mosquitto/certs/server.key Instead of: cafile c:\etc\mosquitto\ca_certificates\ca.crt certfile c:\etc\mosquitto\certs\server.crt keyfile … Read more

[Solved] Base64 decoding – incorrect string length

Are you using str[n]cpy? You can’t! Base64 encoded data can contain null characters, which C string processing functions interpret as end-of-string. Use memcpy instead of str[n]cpy, memcmp instead of strcmp, etc. These functions require you to know your data size, but I believe that you do know it. Also if you’re not very confident about … Read more