Skip to content

Commit a4d9a38

Browse files
committed
MbedSSLClient: load certificates from filesystem only if supported
1 parent f0e429a commit a4d9a38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: libraries/SocketWrapper/src/MbedSSLClient.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ class MbedSSLClient : public arduino::MbedClient {
5858

5959
private:
6060
int setRootCA() {
61+
int err = 0;
62+
63+
#if defined(MBEDTLS_FS_IO)
6164
mbed::BlockDevice* root = mbed::BlockDevice::get_default_instance();
62-
int err = root->init();
65+
err = root->init();
6366
if( err != 0) {
6467
return err;
6568
}
@@ -76,6 +79,7 @@ class MbedSSLClient : public arduino::MbedClient {
7679
if( err != NSAPI_ERROR_OK) {
7780
return err;
7881
}
82+
#endif
7983

8084
if(_ca_cert_custom != NULL) {
8185
err = ((TLSSocket*)sock)->append_root_ca_cert(_ca_cert_custom);

0 commit comments

Comments
 (0)