Skip to content

Commit

Permalink
Merge pull request #152 from brentru/fix-esp32-cert-issue
Browse files Browse the repository at this point in the history
Update for ESP32
  • Loading branch information
brentru authored May 17, 2021
2 parents 3c1ab07 + dd3b67a commit 5742073
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit IO Arduino
version=4.0.2
version=4.1.0
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library to access Adafruit IO.
Expand Down
6 changes: 3 additions & 3 deletions src/wifi/AdafruitIO_ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Please support Adafruit and open source hardware by purchasing
* products from Adafruit!
*
* Copyright (c) 2015-2016 Adafruit Industries
* Authors: Tony DiCola, Todd Treece
* Copyright (c) 2015-2021 Adafruit Industries
* Authors: Tony DiCola, Todd Treece, Brent Rubell
* Licensed under the MIT license.
*
* All text above must be included in any redistribution.
Expand Down Expand Up @@ -42,6 +42,7 @@ void AdafruitIO_ESP32::_connect() {
delay(100);
_status = AIO_NET_DISCONNECTED;
}
_client->setCACert(_aio_root_ca);
}

/**************************************************************************/
Expand All @@ -55,7 +56,6 @@ void AdafruitIO_ESP32::_disconnect() {
}

aio_status_t AdafruitIO_ESP32::networkStatus() {

switch (WiFi.status()) {
case WL_CONNECTED:
return AIO_NET_CONNECTED;
Expand Down
29 changes: 27 additions & 2 deletions src/wifi/AdafruitIO_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Please support Adafruit and open source hardware by purchasing
* products from Adafruit!
*
* Copyright (c) 2015-2016 Adafruit Industries
* Authors: Tony DiCola, Todd Treece
* Copyright (c) 2015-2021 Adafruit Industries
* Authors: Tony DiCola, Todd Treece, Brent Rubell
* Licensed under the MIT license.
*
* All text above must be included in any redistribution.
Expand Down Expand Up @@ -42,6 +42,31 @@ class AdafruitIO_ESP32 : public AdafruitIO {
const char *_pass;

WiFiClientSecure *_client;

// io.adafruit.com root CA
const char *_aio_root_ca =
"-----BEGIN CERTIFICATE-----\n"
"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
"-----END CERTIFICATE-----\n";
};

#endif // ESP32
Expand Down

0 comments on commit 5742073

Please sign in to comment.