Skip to content

Commit 1398e59

Browse files
committed
Fix SSL verification time issue.
1 parent 3c99bae commit 1398e59

7 files changed

+26
-12
lines changed

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP-Google-Sheet-Client",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"keywords": "communication, REST, esp32, esp8266, raspberrypi, arduino",
55
"description": "Arduino Google Sheet REST client library for Arduino devices. This library allows devices to communicate with Google Sheet API to read, edit and delete the spreadsheets",
66
"repository": {

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=ESP-Google-Sheet-Client
22

3-
version=1.4.2
3+
version=1.4.3
44

55
author=Mobizt
66

src/ESP_Google_Sheet_Client.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Google Sheet Client, ESP_GOOGLE_SHEET_CLIENT_Google_Sheet_Client.cpp v1.4.2
2+
* Google Sheet Client, ESP_GOOGLE_SHEET_CLIENT_Google_Sheet_Client.cpp v1.4.3
33
*
44
* This library supports Espressif ESP8266 and ESP32 MCUs
55
*
6-
* Created November 9, 2023
6+
* Created November 10, 2023
77
*
88
* The MIT License (MIT)
99
* Copyright (c) 2022 K. Suwatchai (Mobizt)

src/ESP_Google_Sheet_Client.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#ifndef ESP_GOOGLE_SHEET_CLIENT_VERSION
2-
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.2"
2+
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.3"
33
#endif
44

55
/**
6-
* Google Sheet Client, ESP_Google_Sheet_Client.h v1.4.2
6+
* Google Sheet Client, ESP_Google_Sheet_Client.h v1.4.3
77
*
88
* This library supports Espressif ESP8266 and ESP32 MCUs
99
*
10-
* Created November 9, 2023
10+
* Created November 10, 2023
1111
*
1212
* The MIT License (MIT)
1313
* Copyright (c) 2023 K. Suwatchai (Mobizt)

src/auth/GAuthManager.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Google Sheet Client, GAuthManager v1.0.4
2+
* Google Sheet Client, GAuthManager v1.0.5
33
*
44
* This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico MCUs.
55
*
6-
* Created August 21, 2023
6+
* Created November 10, 2023
77
*
88
* The MIT License (MIT)
99
* Copyright (c) 2022 K. Suwatchai (Mobizt)
@@ -990,6 +990,10 @@ bool GAuthManager::initClient(PGM_P subDomain, gauth_auth_token_status status)
990990
Utils::idle();
991991
tcpClient->begin(host.c_str(), 443, &response_code);
992992

993+
time_t now = getTime();
994+
995+
tcpClient->setX509Time(now);
996+
993997
return true;
994998
}
995999

src/auth/GAuthManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Google Sheet Client, GAuthManager v1.0.4
2+
* Google Sheet Client, GAuthManager v1.0.5
33
*
44
* This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico MCUs.
55
*
6-
* Created August 21, 2023
6+
* Created November 10, 2023
77
*
88
* The MIT License (MIT)
99
* Copyright (c) 2022 K. Suwatchai (Mobizt)

src/client/GS_TCP_Client.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ class GS_TCP_Client : public Client
116116
#endif
117117
}
118118

119+
void setX509Time(time_t now)
120+
{
121+
if (_tcp_client)
122+
{
123+
_tcp_client->setX509Time(now);
124+
if (now > ESP_SSLCLIENT_VALID_TIMESTAMP)
125+
_clock_ready = true;
126+
}
127+
}
128+
119129
/**
120130
* Set Root CA certificate to verify.
121131
* @param caCert The certificate.
@@ -933,7 +943,7 @@ class GS_TCP_Client : public Client
933943
{
934944
if (gsmModem->getNetworkTime(&year3, &month3, &day3, &hour3, &min3, &sec3, &timezone))
935945
{
936-
//We have to subtract the local GSM network timezone to get GMT time
946+
// We have to subtract the local GSM network timezone to get GMT time
937947
return TimeHelper::getTimestamp(year3, month3, day3, hour3, min3, sec3) - timezone * 3600;
938948
}
939949
}

0 commit comments

Comments
 (0)