nabto_device_set_root_certs()
DESCRIPTION
Set root certs
By default the device is configured to trust “Nabto Root CA 1”. This behavior can be overridden by the following function. All trusted root certs should be in the string and be encoded as PEM. The certs replace the trusted root certs, including the default, so only the certs in the latest call are trusted. If the certs cannot be loaded, no root certs are trusted until the function succeeds. Some TLS libraries skip certs they cannot parse and load the rest, so check that all the certs are valid. The certs are copied into the device so the string can be freed after the call.
Root certs are used to validate the connection to the basestation.
DECLARATION
NABTO_DEVICE_DECL_PREFIX NabtoDeviceError NABTO_DEVICE_API
nabto_device_set_root_certs(NabtoDevice* device, const char* roots)
PARAMETERS
device:- [in] The device
roots:- [in] Root certs encoded as pem.
RETURNS
NABTO_DEVICE_EC_OK: iff okNABTO_DEVICE_INVALID_STATE: if device is started
