Skip to content

Commit c3d3d4d

Browse files
authored
Bugfix: 'updateTimestampOnLocallyChangedProperties' was called before a connection had been established which led to the time service having a wrong date configured (1/1/2000) which leads to an expired certificate which inhibits the establishment of a connection to the server since the certificate has expired. This was triggered when properties where changed within 'setup' (#158)
1 parent dd426b4 commit c3d3d4d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ArduinoIoTCloudTCP.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,18 @@ void ArduinoIoTCloudTCP::update()
164164
_ota_error = static_cast<int>(err);
165165
#endif /* OTA_ENABLED */
166166

167-
// Check if a primitive property wrapper is locally changed
168-
updateTimestampOnLocallyChangedProperties(_property_container);
169-
170167
if(checkPhyConnection() != NetworkConnectionState::CONNECTED) return;
171168
if(checkCloudConnection() != ArduinoIoTConnectionStatus::CONNECTED) return;
172169

170+
/* Check if a primitive property wrapper is locally changed.
171+
* This function requires an existing time service which in
172+
* turn requires an established connection. Not having that
173+
* leads to a wrong time set in the time service which inhibits
174+
* the connection from being established due to a wrong data
175+
* in the reconstructed certificate.
176+
*/
177+
updateTimestampOnLocallyChangedProperties(_property_container);
178+
173179
if(_mqtt_data_request_retransmit && (_mqtt_data_len > 0)) {
174180
write(_dataTopicOut, _mqtt_data_buf, _mqtt_data_len);
175181
_mqtt_data_request_retransmit = false;

0 commit comments

Comments
 (0)