@@ -58,7 +58,9 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
58
58
, _mqtt_data_buf{0 }
59
59
, _mqtt_data_len{0 }
60
60
, _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)
62
64
, _sslClient(nullptr , ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM, getTime)
63
65
#endif
64
66
#ifdef BOARD_ESP
@@ -112,15 +114,17 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
112
114
_ota_img_sha256 = FlashSHA256::calc (0x2000 , 0x40000 - 0x2000 );
113
115
#endif /* OTA_ENABLED */
114
116
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)
116
120
if (!ECCX08.begin ()) { DBG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
117
121
if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DBG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
118
122
if (!CryptoUtil::reconstructCertificate (_eccx08_cert, getDeviceId (), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier)) { DBG_ERROR (F (" Cryptography certificate reconstruction failure." )); return 0 ; }
119
123
_sslClient.setClient (_connection->getClient ());
120
124
_sslClient.setEccSlot (static_cast <int >(ECCX08Slot::Key), _eccx08_cert.bytes (), _eccx08_cert.length ());
121
- #elif defined(BOARD_ESP)
125
+ #elif defined(BOARD_ESP)
122
126
_sslClient.setInsecure ();
123
- #endif
127
+ #endif
124
128
125
129
_mqttClient.setClient (_sslClient);
126
130
#ifdef BOARD_ESP
0 commit comments