@@ -58,7 +58,9 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
5858, _mqtt_data_buf{0 }
5959, _mqtt_data_len{0 }
6060, _mqtt_data_request_retransmit{false }
61- #ifdef BOARD_HAS_ECCX08
61+ #if BOARD_HAS_NINA
62+ /* Do nothing here because we are using onboard onboard SSL on NINA. */
63+ #elif defined(BOARD_HAS_ECCX08)
6264, _sslClient(nullptr , ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM, getTime)
6365#endif
6466 #ifdef BOARD_ESP
@@ -112,15 +114,17 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
112114 _ota_img_sha256 = FlashSHA256::calc (0x2000 , 0x40000 - 0x2000 );
113115#endif /* OTA_ENABLED */
114116
115- #ifdef BOARD_HAS_ECCX08
117+ #if BOARD_HAS_NINA
118+ /* Do nothing here because we are using onboard SSL on NINA. */
119+ #elif defined(BOARD_HAS_ECCX08)
116120 if (!ECCX08.begin ()) { DBG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
117121 if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DBG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
118122 if (!CryptoUtil::reconstructCertificate (_eccx08_cert, getDeviceId (), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier)) { DBG_ERROR (F (" Cryptography certificate reconstruction failure." )); return 0 ; }
119123 _sslClient.setClient (_connection->getClient ());
120124 _sslClient.setEccSlot (static_cast <int >(ECCX08Slot::Key), _eccx08_cert.bytes (), _eccx08_cert.length ());
121- #elif defined(BOARD_ESP)
125+ #elif defined(BOARD_ESP)
122126 _sslClient.setInsecure ();
123- #endif
127+ #endif
124128
125129 _mqttClient.setClient (_sslClient);
126130 #ifdef BOARD_ESP
0 commit comments