Dear Nordic Support Team,
I would like my nRF9160 DK to connect to multiple servers using TLS. Among others, I have read the following documentation: nRF9160: Simple MQTT, Zephyr MQTT, TLS/DTLS configuration, Modem key management, and Zephyr BSD Sockets. I am confident that I am able to use Nordic's and Zephyr's libraries to set everything up from a programming perspective. However, there are some things I would like to clarify regarding the provision of certificates.
Since each certificate does occupy a non-neglectable amount of flash and/or RAM memory, my goal is to maximize the amount of servers I can connect to while keeping the set of certificates need as small as possible. Hence my first question: Is it sufficient to provide a few root CA (certificate authority) certificates to Nordic's modem and Zephyr's BSD Sockets library, so that they validate the chain of trust starting with the server's certificate and ending with one of the root CA certificates?
Lets consider nRF9160: Simple MQTT for example.
In the sample, the certificate "Let’s Encrypt R3" is provided to both Nordic's modem and Zephyr's BSD Socket library. However, "Let’s Encrypt R3" is signed by the certificate "Internet Security Research Group ISRG Root X1", which is one of the two root CA certificates of the Internet Security Research Group. Would the MQTT sample work if instead of "Let’s Encrypt R3" "Internet Security Research Group ISRG Root X1" would be provided?
Since the MQTT sample uses Zephyr's MQTT library, why is the certificate provided to Nordic's modem and not only provided to Zephyr's BSD Sockets library (see function certificates_provision())?
I understand that Nordic's modem does store certificates in persistent storage (function modem_key_mgmt_write()). Do you know if Zephyr's BSD Sockets library stores certificates only in RAM? If so, does Zephyr copy the provided certificate or do one needs to keep the buffer, with which the certificate was provided (function tls_credential_add()), in memory? (Sorry for asking you questions about Zephyr, but the documentation seems inconclusive about this point and since Nordic's MQTT sample uses Zephyr's BSD Sockets library, I thought you might know more than I.)
Thank you allot for your help!
Cheers,
Sebastian