From 22919e878cbcf7909cfc14f74bea39ee50a4eb0f Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Fri, 12 Jul 2024 23:01:18 +0100 Subject: [PATCH 01/48] Merge branch 'master' --- .github/ISSUE_TEMPLATE/template | 36 +++++++++++++++++++++++++++++++ .github/workflows/issue_check.yml | 30 ++++++++++++++++++++++++++ Release Note.md => CHANGELOG.md | 0 CONTRIBUTING.md | 23 ++++++++++++++++++++ README.md | 23 ++++++++++++++------ library.properties | 2 +- src/SSLClient.cpp | 2 +- src/certBundle.c | 14 +++++++++++- src/ssl__client.cpp | 17 +++++++++++++-- src/ssl__client.h | 4 ++++ 10 files changed, 139 insertions(+), 12 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/template create mode 100644 .github/workflows/issue_check.yml rename Release Note.md => CHANGELOG.md (100%) create mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/template b/.github/ISSUE_TEMPLATE/template new file mode 100644 index 0000000..63818cd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/template @@ -0,0 +1,36 @@ +<!-- +Please use this template to provide the necessary information for your issue. +--> + +### Description +<!-- A clear and concise description of what the issue is. --> + +### Steps to Reproduce +<!-- Detailed steps to reproduce the issue. --> +<!-- Please include anonymised / sanitised code. It helps us understand what you are trying to do! --> + +1. Go to '...' +2. Click on '...' +3. Scroll down to '...' +4. See error + +### Expected Behavior +<!-- A clear and concise description of what you expected to happen. --> + +### Actual Behavior +<!-- A clear and concise description of what actually happened. --> + +### Environment +<!-- Details about your environment, including the operating system, version, and any other relevant details. --> + +- **Operating System:** [e.g., Windows, macOS, Linux] +- **Version:** [e.g., 1.0.0] + +### IDE +<!-- Specify the IDE you are using. --> + +- [ ] Arduino IDE +- [ ] PlatformIO IDE extension + +### Additional Context +<!-- Add any other context about the problem here. --> diff --git a/.github/workflows/issue_check.yml b/.github/workflows/issue_check.yml new file mode 100644 index 0000000..f73b613 --- /dev/null +++ b/.github/workflows/issue_check.yml @@ -0,0 +1,30 @@ +name: Issue Checker + +on: + issues: + types: [opened] + +jobs: + check-issue: + runs-on: ubuntu-latest + steps: + - name: Check for Required Information + uses: actions/github-script@v4 + with: + script: | + const { issue } = context.payload; + const requiredFields = ['Description', 'Steps to Reproduce', 'Expected Behavior', 'Actual Behavior', 'Environment', 'IDE']; + let missingFields = requiredFields.filter(field => !issue.body.includes(`### ${field}`)); + if (missingFields.length > 0) { + const commentBody = `The following fields are missing: ${missingFields.join(', ')}. Please update the issue with this information.`; + await github.issues.createComment({ + ...context.repo, + issue_number: issue.number, + body: commentBody + }); + await github.issues.addLabels({ + ...context.repo, + issue_number: issue.number, + labels: ['lacking information'] + }); + } diff --git a/Release Note.md b/CHANGELOG.md similarity index 100% rename from Release Note.md rename to CHANGELOG.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7b4541a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing to SSLClient +Thank you for considering contributing to SSLClient! Please follow these guidelines to help us review your contributions more efficiently. + +## How to Report an Issue +1. Search for similar issues in the [issue tracker](https://github.com/govorox/SSLClient/issues) to avoid duplicates. +2. Use the provided [issue templates](https://github.com/govorox/SSLClient/tree/master/.github/ISSUE_TEMPLATE) to ensure all necessary information is included. +3. Provide a clear and descriptive title for the issue. +4. Include steps to reproduce the issue, expected and actual behavior, and details about your environment. + +## How to Submit a Pull Request +1. Fork the repository and create your branch from `main`. +2. Ensure your code follows the project's coding standards. +3. Update documentation as necessary. +4. Link to the relevant issue in the pull request description. +5. Ensure all tests pass before submitting the pull request. + +## Coding Standards +- Follow the [existing code style](CODEGUIDE.md). +- Write clear and concise commit messages. +- Include comments where necessary for clarity. + +## Contact +If you have any questions, feel free to reach out to us at [robbyrnes@hotmail.co.uk]. diff --git a/README.md b/README.md index 452cab7..698bb71 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,31 @@ -# SSLClient Arduino Library (Version 1.2.0) +# SSLClient Library for Arduino and ESP +[](https://github.com/govorox/SSLClient "Go to GitHub repo") +[](https://github.com/govorox/SSLClient) +[](https://github.com/govorox/SSLClient) -#### Available on PlatformIO registry as digitaldragon/SSLClient@1.2.0 -[](https://registry.platformio.org/libraries/digitaldragon/SSLClient) +[](https://github.com/govorox/SSLClient/releases/) +[](#license) +[](https://github.com/govorox/SSLClient/issues) -#### Available on Arduino Libraries registry to digitaldragon/GovoroxSSLClient@1.2.0 -[](https://www.ardu-badge.com/badge/GovoroxSSLClient.svg) +#### Available on PlatformIO registry as digitaldragon/SSLClient +[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") + +#### Available on Arduino Libraries registry to digitaldragon/GovoroxSSLClient +[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") ## 🚀 Overview SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, providing a transparent SSL/TLS layer over any **Client** class instance. Leverages *mbedtls* for robust, efficient cryptographic operations, initially tailored for ESP32 but adaptable across platforms. Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFiClientSecure) for Arduino/ESP32. -## 🌟 What's New in 1.2.0 +## 🌟 What's New **ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. **Cert Bundles**: Simplifies management and use of multiple CA certificates. **Bug Fix**: Corrects byte calculation for record expansion post-handshake. **More Examples**: Examples for the ESP32 PlatformIO for ALPN protocols, AWS, and using certificate bundles. +### For more details, see the [CHANGELOG](CHANGELOG.md). + ## ✨ Features - Secure TLS communication. - Based on mbedtls. @@ -120,4 +129,4 @@ The library is released under GNU General Public Licence. See the LICENSE file f | 31 | -51 dBm or more | Excellent signal | ## 🖥 Contributing -Contributions are welcome! Please fork the repository and submit pull requests with your enhancements. \ No newline at end of file +Contributions are welcome! Please fork the repository and submit pull requests with your enhancements. For more information on contributing, please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file. \ No newline at end of file diff --git a/library.properties b/library.properties index 86b9388..98104a9 100644 --- a/library.properties +++ b/library.properties @@ -2,7 +2,7 @@ name=GovoroxSSLClient version=1.2.0 author=V Govorovski maintainer=Robert Byrnes <robbyrnes@hotmail.co.uk> -sentence=Provides secure network connection over a generic Client trasport object. +sentence=Provides secure network connection over a generic Client transport object. paragraph=With this library you can make a TLS or SSL connection to a remote server. category=Communication url=https://github.com/govorox/SSLClient.git diff --git a/src/SSLClient.cpp b/src/SSLClient.cpp index 12cc6aa..dae9ae8 100644 --- a/src/SSLClient.cpp +++ b/src/SSLClient.cpp @@ -93,7 +93,7 @@ SSLClient::~SSLClient() { */ void SSLClient::stop() { if (sslclient->client != nullptr) { - if (sslclient->client >= 0) { + if (sslclient->client >= (void*)0) { log_d("Stopping ssl client"); stop_ssl_socket(sslclient, _CA_cert, _cert, _private_key); } else { diff --git a/src/certBundle.c b/src/certBundle.c index f7f13a9..b2d6db6 100644 --- a/src/certBundle.c +++ b/src/certBundle.c @@ -53,20 +53,32 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k // Fast check to avoid expensive computations when not necessary +#if (MBEDTLS_VERSION_MAJOR >= 3) + if (!mbedtls_pk_can_do(&parent.pk, child->private_sig_pk)) { +#else if (!mbedtls_pk_can_do(&parent.pk, child->sig_pk)) { +#endif log_e("Simple compare failed"); ret = -1; goto cleanup; } +#if (MBEDTLS_VERSION_MAJOR >= 3) + md_info = mbedtls_md_info_from_type(child->private_sig_md); +#else md_info = mbedtls_md_info_from_type(child->sig_md); +#endif if ( (ret = mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash )) != 0 ) { log_e("Internal mbedTLS error %X", ret); goto cleanup; } - +#if (MBEDTLS_VERSION_MAJOR >= 3) + if ((ret = mbedtls_pk_verify_ext(child->private_sig_pk, child->private_sig_opts, &parent.pk, child->private_sig_md, hash, mbedtls_md_get_size( md_info ), + child->private_sig.p, child->private_sig.len )) != 0 ) { +#else if ((ret = mbedtls_pk_verify_ext(child->sig_pk, child->sig_opts, &parent.pk, child->sig_md, hash, mbedtls_md_get_size( md_info ), child->sig.p, child->sig.len )) != 0 ) { +#endif log_e("PK verify failed with error %X", ret); goto cleanup; } diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index 199c40b..e4ee2bc 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -576,7 +576,14 @@ int auth_client_cert_key(sslclient__context *ssl_client, const char *cli_cert, c } log_v("Loading private key"); +#if (MBEDTLS_VERSION_MAJOR >= 3) + mbedtls_ctr_drbg_context ctr_drbg; + mbedtls_ctr_drbg_init(&ctr_drbg); + ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0, mbedtls_ctr_drbg_random, &ctr_drbg); + mbedtls_ctr_drbg_free(&ctr_drbg); +#else ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0); +#endif if (ret != 0) { // PK or PEM non-zero error codes mbedtls_x509_crt_free(&ssl_client->client_cert); // cert+key are free'd in pair return ret; @@ -814,15 +821,21 @@ void stop_ssl_socket(sslclient__context *ssl_client, const char *rootCABuff, con log_d("Stopping SSL client. Current client pointer address: %p", (void *)ssl_client->client); ssl_client->client->stop(); } - +#if (MBEDTLS_VERSION_MAJOR >= 3) + if (ssl_client->ssl_conf.private_ca_chain != NULL) { +#else if (ssl_client->ssl_conf.ca_chain != NULL) { +#endif log_d("Freeing CA cert. Current ca_cert address: %p", (void *)&ssl_client->ca_cert); // Free the memory associated with the CA certificate mbedtls_x509_crt_free(&ssl_client->ca_cert); } - +#if (MBEDTLS_VERSION_MAJOR >= 3) + if (ssl_client->ssl_conf.private_key_cert != NULL) { +#else if (ssl_client->ssl_conf.key_cert != NULL) { +#endif log_d("Freeing client cert and client key. Current client_cert address: %p, client_key address: %p", (void *)&ssl_client->client_cert, (void *)&ssl_client->client_key); diff --git a/src/ssl__client.h b/src/ssl__client.h index 556494d..bc04112 100644 --- a/src/ssl__client.h +++ b/src/ssl__client.h @@ -12,7 +12,11 @@ #include <mbedtls/platform.h> #include <mbedtls/sha256.h> #include <mbedtls/oid.h> +#if (MBEDTLS_VERSION_MAJOR >= 3) +#include <mbedtls/net_sockets.h> +#else #include <mbedtls/net.h> +#endif #include <mbedtls/debug.h> #include <mbedtls/ssl.h> #include <mbedtls/entropy.h> From 635ad796db12f95718d6848e7f8ab9449319f8b6 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 21:27:27 +0100 Subject: [PATCH 02/48] chore: Update MBEDTLS_VERSION_MAJOR and MBEDTLS_BACKPORT flags --- .github/workflows/ci_master.yml | 12 +++++++++++- platformio.ini | 3 ++- src/certBundle.c | 6 +++--- src/ssl__client.cpp | 6 +++--- src/ssl__client.h | 2 +- test/mocks/MbedTLS.h | 24 ++++++++++++++++++------ test/unit_test_private_api.cpp | 5 +++++ 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index e377f84..bb1376c 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -5,6 +5,7 @@ on: branches: - master - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: jobs: test: @@ -23,5 +24,14 @@ jobs: run: | pip install platformio - - name: Run tests + - name: Set Environment MBEDTLS_VERSION_MAJOR Variable + run: echo "MBEDTLS_VERSION_MAJOR=3" >> $GITHUB_ENV + + - name: Run tests - First Batch + run: pio test -e native -vvv + + - name: Set Environment MBEDTLS_BACKPORT Variable + run: echo "MBEDTLS_BACKPORT=true" >> $GITHUB_ENV + + - name: Run tests - Second Batch run: pio test -e native -vvv diff --git a/platformio.ini b/platformio.ini index cb5a0c9..3802729 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,10 +17,11 @@ build_type = test lib_deps = digitaldragon/Emulation@0.1.6 throwtheswitch/Unity@^2.5.2 - # mbedtls=https://github.com/ARMmbed/mbedtls.git#mbedtls-2.28.0 lib_ldf_mode = deep+ build_unflags = -std=gnu++11 build_flags = -std=gnu++17 -I test/mocks -D SSL_CLIENT_TEST_ENVIRONMENT + ; -D MBEDTLS_VERSION_MAJOR=3 + ; -D MBEDTLS_BACKPORT diff --git a/src/certBundle.c b/src/certBundle.c index b2d6db6..b205751 100644 --- a/src/certBundle.c +++ b/src/certBundle.c @@ -53,7 +53,7 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k // Fast check to avoid expensive computations when not necessary -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) if (!mbedtls_pk_can_do(&parent.pk, child->private_sig_pk)) { #else if (!mbedtls_pk_can_do(&parent.pk, child->sig_pk)) { @@ -63,7 +63,7 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k goto cleanup; } -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) md_info = mbedtls_md_info_from_type(child->private_sig_md); #else md_info = mbedtls_md_info_from_type(child->sig_md); @@ -72,7 +72,7 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k log_e("Internal mbedTLS error %X", ret); goto cleanup; } -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) if ((ret = mbedtls_pk_verify_ext(child->private_sig_pk, child->private_sig_opts, &parent.pk, child->private_sig_md, hash, mbedtls_md_get_size( md_info ), child->private_sig.p, child->private_sig.len )) != 0 ) { #else diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index e4ee2bc..3af6f00 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -576,7 +576,7 @@ int auth_client_cert_key(sslclient__context *ssl_client, const char *cli_cert, c } log_v("Loading private key"); -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ctr_drbg_init(&ctr_drbg); ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0, mbedtls_ctr_drbg_random, &ctr_drbg); @@ -821,7 +821,7 @@ void stop_ssl_socket(sslclient__context *ssl_client, const char *rootCABuff, con log_d("Stopping SSL client. Current client pointer address: %p", (void *)ssl_client->client); ssl_client->client->stop(); } -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) if (ssl_client->ssl_conf.private_ca_chain != NULL) { #else if (ssl_client->ssl_conf.ca_chain != NULL) { @@ -831,7 +831,7 @@ void stop_ssl_socket(sslclient__context *ssl_client, const char *rootCABuff, con // Free the memory associated with the CA certificate mbedtls_x509_crt_free(&ssl_client->ca_cert); } -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) if (ssl_client->ssl_conf.private_key_cert != NULL) { #else if (ssl_client->ssl_conf.key_cert != NULL) { diff --git a/src/ssl__client.h b/src/ssl__client.h index bc04112..dc009db 100644 --- a/src/ssl__client.h +++ b/src/ssl__client.h @@ -12,7 +12,7 @@ #include <mbedtls/platform.h> #include <mbedtls/sha256.h> #include <mbedtls/oid.h> -#if (MBEDTLS_VERSION_MAJOR >= 3) +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) #include <mbedtls/net_sockets.h> #else #include <mbedtls/net.h> diff --git a/test/mocks/MbedTLS.h b/test/mocks/MbedTLS.h index 9ac177b..08b624d 100644 --- a/test/mocks/MbedTLS.h +++ b/test/mocks/MbedTLS.h @@ -105,8 +105,13 @@ struct mbedtls_x509_crt { mbedtls_x509_buf tbs; }; struct mbedtls_ssl_config { +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) + void* private_ca_chain; + void* private_key_cert; +#else void* ca_chain; void* key_cert; +#endif mbedtls_x509_crt* actual_ca_chain; mbedtls_x509_crt* actual_key_cert; }; @@ -361,11 +366,24 @@ int mbedtls_ssl_conf_psk(mbedtls_ssl_config *conf, const unsigned char *psk, siz return mbedtls_ssl_conf_psk_stub.mock<int>("mbedtls_ssl_conf_psk"); } +FunctionEmulator mbedtls_ctr_drbg_random_stub("mbedtls_ctr_drbg_random"); +int mbedtls_ctr_drbg_random(void *p_rng, unsigned char *output, size_t output_len) { + mbedtls_ctr_drbg_random_stub.recordFunctionCall(); + return mbedtls_ctr_drbg_random_stub.mock<int>("mbedtls_ctr_drbg_random"); +} + FunctionEmulator mbedtls_pk_parse_key_stub("mbedtls_pk_parse_key"); +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) +int mbedtls_pk_parse_key(mbedtls_pk_context *ctx, const unsigned char *key, size_t keylen, const unsigned char *pwd, size_t pwdlen, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng) { + mbedtls_pk_parse_key_stub.recordFunctionCall(); + return mbedtls_pk_parse_key_stub.mock<int>("mbedtls_pk_parse_key"); +} +#else int mbedtls_pk_parse_key(mbedtls_pk_context *pk, const unsigned char *key, size_t keylen, const unsigned char *pwd, size_t pwdlen) { mbedtls_pk_parse_key_stub.recordFunctionCall(); return mbedtls_pk_parse_key_stub.mock<int>("mbedtls_pk_parse_key"); } +#endif FunctionEmulator mbedtls_ssl_conf_own_cert_stub("mbedtls_ssl_conf_own_cert"); int mbedtls_ssl_conf_own_cert(mbedtls_ssl_config *conf, mbedtls_x509_crt *own_cert, mbedtls_pk_context *pk_key) { @@ -379,12 +397,6 @@ int mbedtls_ssl_set_hostname(mbedtls_ssl_context *ssl, const char *hostname) { return mbedtls_ssl_set_hostname_stub.mock<int>("mbedtls_ssl_set_hostname"); } -FunctionEmulator mbedtls_ctr_drbg_random_stub("mbedtls_ctr_drbg_random"); -int mbedtls_ctr_drbg_random(void *p_rng, unsigned char *output, size_t output_len) { - mbedtls_ctr_drbg_random_stub.recordFunctionCall(); - return mbedtls_ctr_drbg_random_stub.mock<int>("mbedtls_ctr_drbg_random"); -} - FunctionEmulator mbedtls_ssl_setup_stub("mbedtls_ssl_setup"); int mbedtls_ssl_setup(mbedtls_ssl_context *ssl, const mbedtls_ssl_config *conf) { mbedtls_ssl_setup_stub.recordFunctionCall(); diff --git a/test/unit_test_private_api.cpp b/test/unit_test_private_api.cpp index 0085723..529eb5a 100644 --- a/test/unit_test_private_api.cpp +++ b/test/unit_test_private_api.cpp @@ -25,8 +25,13 @@ sslclient__context *testContext; // Context for tests void setup_stop_ssl_socket(sslclient__context* ctx, Client* client) { ctx->ssl_conf.actual_ca_chain = (mbedtls_x509_crt*) malloc(sizeof(mbedtls_x509_crt)); ctx->ssl_conf.actual_key_cert = &dummy_cert; +#if (MBEDTLS_VERSION_MAJOR >= 3) && !defined(MBEDTLS_BACKPORT) + ctx->ssl_conf.private_ca_chain = ctx->ssl_conf.actual_ca_chain; + ctx->ssl_conf.private_key_cert = ctx->ssl_conf.actual_key_cert; +#else ctx->ssl_conf.ca_chain = ctx->ssl_conf.actual_ca_chain; ctx->ssl_conf.key_cert = ctx->ssl_conf.actual_key_cert; +#endif } void setUp(void) { From e5d246f3576c057c34165f36cddf4dacdb3a7f94 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 21:33:20 +0100 Subject: [PATCH 03/48] chore: Update CI configuration to include push events for master and version branches --- .github/workflows/ci_master.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index bb1376c..d2066dc 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -1,6 +1,10 @@ name: Run PlatformIO Tests on: + push: + branches: + - master + - 'v[0-9]+.[0-9]+.[0-9]+' pull_request: branches: - master From 2d0d51b043a65bd030d8e5bb39040b8d9952a6fe Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 21:35:17 +0100 Subject: [PATCH 04/48] chore: Clean up and set Environment MBEDTLS_BACKPORT Variable --- .github/workflows/ci_master.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index d2066dc..b7e3d46 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -34,6 +34,9 @@ jobs: - name: Run tests - First Batch run: pio test -e native -vvv + - name: Clean up + run: pio run -t clean + - name: Set Environment MBEDTLS_BACKPORT Variable run: echo "MBEDTLS_BACKPORT=true" >> $GITHUB_ENV From f238890fee9cdc1b1edc64b984329be1193ae1ef Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 21:46:24 +0100 Subject: [PATCH 05/48] chore: Refactor CI workflow to clean up and set environment variables for multiple test batches --- .github/workflows/ci_master.yml | 11 ++++++++++- platformio.ini | 2 ++ src/ssl__client.cpp | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index b7e3d46..207cecc 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -34,7 +34,7 @@ jobs: - name: Run tests - First Batch run: pio test -e native -vvv - - name: Clean up + - name: Clean up - First Batch run: pio run -t clean - name: Set Environment MBEDTLS_BACKPORT Variable @@ -42,3 +42,12 @@ jobs: - name: Run tests - Second Batch run: pio test -e native -vvv + + - name: Clean up - Second Batch + run: pio run -t clean + + - name: Set Environment W5500_WORKAROUND Variable + run: echo "W5500_WORKAROUND=true" >> $GITHUB_ENV + + - name: Run tests - Third Batch + run: pio test -e native -vvv diff --git a/platformio.ini b/platformio.ini index 3802729..46c11c3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,3 +25,5 @@ build_flags = -D SSL_CLIENT_TEST_ENVIRONMENT ; -D MBEDTLS_VERSION_MAJOR=3 ; -D MBEDTLS_BACKPORT + ; -D _W5500_H_ + ; -D W5500_WORKAROUND diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index 3af6f00..3a4d28c 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -730,9 +730,16 @@ int perform_ssl_handshake(sslclient__context *ssl_client, const char *cli_cert, unsigned long handshake_start_time = millis(); log_d("calling mbedtls_ssl_handshake with ssl_ctx address %p", (void *)&ssl_client->ssl_ctx); + int loopCount = 0; while ((ret = mbedtls_ssl_handshake(&ssl_client->ssl_ctx)) != 0) { + loopCount++; + #if defined(_W5500_H_) || defined(W5500_WORKAROUND) + if (ret == -1 && loopCount < 200) { + continue; // Treat -1 as a non-error for up to 200 iterations + } + #endif if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { - break; + break; // Break on any other error } if ((millis()-handshake_start_time) > ssl_client->handshake_timeout) { From f158dae689b768cbbdb147ee7a07229c3164fde2 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 22:11:57 +0100 Subject: [PATCH 06/48] chore: link docs --- README.md | 63 ++++++------------------- CHANGELOG.md => docs/CHANGELOG.md | 15 +++++- CODEGUIDE.md => docs/CODEGUIDE.md | 2 + CONTRIBUTING.md => docs/CONTRIBUTING.md | 2 + docs/FUNCTIONS.md | 48 +++++++++++++++++++ 5 files changed, 79 insertions(+), 51 deletions(-) rename CHANGELOG.md => docs/CHANGELOG.md (75%) rename CODEGUIDE.md => docs/CODEGUIDE.md (94%) rename CONTRIBUTING.md => docs/CONTRIBUTING.md (91%) create mode 100644 docs/FUNCTIONS.md diff --git a/README.md b/README.md index 698bb71..d7cde62 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # SSLClient Library for Arduino and ESP + [](https://github.com/govorox/SSLClient "Go to GitHub repo") [](https://github.com/govorox/SSLClient) [](https://github.com/govorox/SSLClient) @@ -7,39 +8,41 @@ [](#license) [](https://github.com/govorox/SSLClient/issues) -#### Available on PlatformIO registry as digitaldragon/SSLClient [](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") -#### Available on Arduino Libraries registry to digitaldragon/GovoroxSSLClient [](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") ## 🚀 Overview + SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, providing a transparent SSL/TLS layer over any **Client** class instance. Leverages *mbedtls* for robust, efficient cryptographic operations, initially tailored for ESP32 but adaptable across platforms. Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFiClientSecure) for Arduino/ESP32. ## 🌟 What's New + **ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. **Cert Bundles**: Simplifies management and use of multiple CA certificates. **Bug Fix**: Corrects byte calculation for record expansion post-handshake. **More Examples**: Examples for the ESP32 PlatformIO for ALPN protocols, AWS, and using certificate bundles. -### For more details, see the [CHANGELOG](CHANGELOG.md). - ## ✨ Features + - Secure TLS communication. - Based on mbedtls. - Compatible with Arduino/ESP32 and potentially other platforms. - Suitable for IoT applications, including AWS IoT. ## 🔧 Installation + Install via the Arduino Library Manager or PlatformIO: Arduino IDE: Search for "SSLClient". PlatformIO: Add `digitaldragon/SSLClient@^1.2.0` to platformio.ini. ## 🛠Usage + ### Basic Connection + ```cpp #include <SSLClient.h> @@ -53,6 +56,7 @@ SSLClient sslClient(&transport); ``` ### AWS IoT Connectivity + ```cpp TinyGsmClient transport(modem); SSLClient secure(&transport); @@ -66,58 +70,22 @@ secure.setPrivateKey(AWS_CERT_PRIVATE); MQTTClient mqtt = MQTTClient(256); mqtt.begin(AWS_IOT_ENDPOINT, 8883, secure); ``` -### 📚 Application Notes -The `SSLClient.cpp` file provides a comprehensive suite of functions for handling SSL/TLS connections in an Arduino environment, particularly for the ESP32. These functions can be categorized into several key areas of functionality, which are essential for understanding the library's capabilities. Here's a user guide to the functionality based on the documentation blocks of these functions: -### Error Handling -- **`_handle_error(int err, const char* function, int line)`**: This function is used internally to handle errors. It interprets the error code returned by various SSL operations and logs it for debugging purposes. +### For details on the functions, see [📚 Function Notes](docs/FUNCTIONS.md) -### Network Communication -- **`client_net_recv(void *ctx, unsigned char *buf, size_t len)`**: Receives data over an established SSL connection. It checks for a valid client context and returns the number of bytes received or an error code. -- **`client_net_recv_timeout(void *ctx, unsigned char *buf, size_t len, uint32_t timeout)`**: Similar to `client_net_recv`, but with an additional timeout parameter. It's useful for non-blocking operations. -- **`client_net_send(void *ctx, const unsigned char *buf, size_t len)`**: Sends data over an SSL connection. It ensures that the client is properly initialized and connected before sending data. +## 🖥 Contributions Welcome -### Initialization and Cleanup -- **`ssl_init(sslclient_context *ssl_client, Client *client)`**: Initializes the SSL context with default values and sets up necessary SSL configurations. -- **`cleanup(sslclient_context *ssl_client, bool ca_cert_initialized, bool client_cert_initialized, bool client_key_initialized, int ret, const char *rootCABuff, const char *cli_cert, const char *cli_key)`**: Frees allocated resources and stops the SSL socket if an error occurred during SSL operations. +Contributions are welcome! Please fork the repository and submit pull requests with your enhancements. For more information on contributing, please refer to the [Contributing Guide](docs/CONTRIBUTING.md). -### SSL Client Start and Configuration -- **`start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey)`**: Handles the entire process of starting an SSL client, including TCP connection initiation, random number generation seeding, SSL/TLS defaults setup, authentication, and SSL handshake. -- **`init_tcp_connection(sslclient_context *ssl_client, const char *host, uint32_t port)`**: Initializes a TCP connection to a remote host. -- **`seed_random_number_generator(sslclient_context *ssl_client)`**: Seeds the random number generator critical for SSL/TLS operations. -- **`set_up_tls_defaults(sslclient_context *ssl_client)`**: Sets up SSL/TLS configuration with default settings. -- **`auth_root_ca_buff(sslclient_context *ssl_client, const char *rootCABuff, bool *ca_cert_initialized, const char *pskIdent, const char *psKey)`**: Configures SSL/TLS authentication options based on provided CA certificates or pre-shared keys. -- **`auth_client_cert_key(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key, bool *client_cert_initialized, bool *client_key_initialized)`**: Loads and initializes the client's certificate and private key for SSL/TLS authentication. -- **`set_hostname_for_tls(sslclient_context *ssl_client, const char *host)`**: Sets the hostname for the TLS session, which should match the Common Name (CN) in the server's certificate. +## For more details, see the [Change Log](docs/CHANGELOG.md). -### SSL Handshake and Verification -- **`perform_ssl_handshake(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key)`**: Manages the SSL/TLS handshake process. -- **`verify_server_cert(sslclient_context *ssl_client)`**: Verifies the server's certificate against the provided root CA. - -### Data Transmission and Reception -- **`data_to_read(sslclient_context *ssl_client)`**: Checks if there is data available to read from the SSL connection. -- **`send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, size_t len)`**: Sends data over an established SSL connection. -- **`get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, size_t length)`**: Receives data from the SSL connection. - -### Certificate Validation -- **`verify_ssl_fingerprint(sslclient_context *ssl_client, const char* fp, const char* domain_name)`**: Verifies the certificate provided by the peer against a specified SHA256 fingerprint. -- **`verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name)`**: Checks if the peer certificate contains the specified domain name in its Common Name (CN) or Subject Alternative Names (SANs). - -### Utility Functions -- **`parse_hex_nibble(char pb, uint8_t* res)`**: Parses a hexadecimal nibble into its binary representation. -- **`match_name(const string& name, const string& domainName - -)`**: Compares a name from a certificate to a domain name to check if they match. - -### Cleanup and Socket Management -- **`stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key)`**: Stops the SSL socket and frees associated resources. - -This user guide provides a comprehensive overview of each function, offering insights into how to use the SSLClient library effectively for secure communication in Arduino-based projects. Each function is designed to handle specific aspects of SSL/TLS communication, from establishing connections and handling data transmission to managing certificates and ensuring security. ## 📄 License + The library is released under GNU General Public Licence. See the LICENSE file for more details. ## 📶 Handy CSQ / RSSI / Signal Strength Mapping + | CSQ Value | RSSI (dBm) | Description | |-----------|---------------------|------------------| | 0 | -113 dBm or less | No signal | @@ -127,6 +95,3 @@ The library is released under GNU General Public Licence. See the LICENSE file f | 15-19 | -81 dBm to -73 dBm | Good signal | | 20-30 | -71 dBm to -53 dBm | Very good signal | | 31 | -51 dBm or more | Excellent signal | - -## 🖥 Contributing -Contributions are welcome! Please fork the repository and submit pull requests with your enhancements. For more information on contributing, please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file. \ No newline at end of file diff --git a/CHANGELOG.md b/docs/CHANGELOG.md similarity index 75% rename from CHANGELOG.md rename to docs/CHANGELOG.md index 4a35b28..c52ffac 100644 --- a/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,12 +1,23 @@ -SSL Client Updates: +[](../README.md) + +# SSL Client Updates: 1. Added some commits of WifiSecureClient to fix some bugs. + 2. Change send_ssl_data to use size_t instead of uint16_t, commit a299ddc + 3. ssl_client.cpp: Fix parameter name in _handle_error, commit : 39155e7 + 4. Fix memory leaks when SSL/TLS connection fails, commit : f29f448 + 5. Fix buffer issue when writing data larger than receiving buffer, commit: 4ce6c5f + 6. Fix issue where client read timeout value not being set, commit: 59ae9f0 + 7. Add clarity to return values for start_ssl_client and fix early termination of ssl client, commit: cc40266 + 8. Close issue [#30](https://github.com/govorox/SSLClient/issues/30), commit: e426936 -9. Separate concerns from start_ssl_client into singly responsible functions and unit test private API, commit: 0f1fa36 + +9. Separate concerns from start_ssl_client into singly responsible functions and unit test private API, commit: 0f1fa36 + 10. Close issue [#60](https://github.com/govorox/SSLClient/issues/60), Naming collision changes to make compatibile compilation with WiFiClientSecure, commit: b8a9e7e \ No newline at end of file diff --git a/CODEGUIDE.md b/docs/CODEGUIDE.md similarity index 94% rename from CODEGUIDE.md rename to docs/CODEGUIDE.md index 2244468..aa40c54 100644 --- a/CODEGUIDE.md +++ b/docs/CODEGUIDE.md @@ -1,3 +1,5 @@ +[](../README.md) + # Code Standards ## Tests diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 91% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 7b4541a..3540733 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,3 +1,5 @@ +[](../README.md) + # Contributing to SSLClient Thank you for considering contributing to SSLClient! Please follow these guidelines to help us review your contributions more efficiently. diff --git a/docs/FUNCTIONS.md b/docs/FUNCTIONS.md new file mode 100644 index 0000000..39f19d6 --- /dev/null +++ b/docs/FUNCTIONS.md @@ -0,0 +1,48 @@ +[](../README.md) + +# 📚 Function Notes + +The `SSLClient.cpp` file provides a comprehensive suite of functions for handling SSL/TLS connections in an Arduino environment, particularly for the ESP32. These functions can be categorized into several key areas of functionality, which are essential for understanding the library's capabilities. Here's a user guide to the functionality based on the documentation blocks of these functions: + +## Error Handling +- **`_handle_error(int err, const char* function, int line)`**: This function is used internally to handle errors. It interprets the error code returned by various SSL operations and logs it for debugging purposes. + +## Network Communication +- **`client_net_recv(void *ctx, unsigned char *buf, size_t len)`**: Receives data over an established SSL connection. It checks for a valid client context and returns the number of bytes received or an error code. +- **`client_net_recv_timeout(void *ctx, unsigned char *buf, size_t len, uint32_t timeout)`**: Similar to `client_net_recv`, but with an additional timeout parameter. It's useful for non-blocking operations. +- **`client_net_send(void *ctx, const unsigned char *buf, size_t len)`**: Sends data over an SSL connection. It ensures that the client is properly initialized and connected before sending data. + +## Initialization and Cleanup +- **`ssl_init(sslclient_context *ssl_client, Client *client)`**: Initializes the SSL context with default values and sets up necessary SSL configurations. +- **`cleanup(sslclient_context *ssl_client, bool ca_cert_initialized, bool client_cert_initialized, bool client_key_initialized, int ret, const char *rootCABuff, const char *cli_cert, const char *cli_key)`**: Frees allocated resources and stops the SSL socket if an error occurred during SSL operations. + +## SSL Client Start and Configuration +- **`start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey)`**: Handles the entire process of starting an SSL client, including TCP connection initiation, random number generation seeding, SSL/TLS defaults setup, authentication, and SSL handshake. +- **`init_tcp_connection(sslclient_context *ssl_client, const char *host, uint32_t port)`**: Initializes a TCP connection to a remote host. +- **`seed_random_number_generator(sslclient_context *ssl_client)`**: Seeds the random number generator critical for SSL/TLS operations. +- **`set_up_tls_defaults(sslclient_context *ssl_client)`**: Sets up SSL/TLS configuration with default settings. +- **`auth_root_ca_buff(sslclient_context *ssl_client, const char *rootCABuff, bool *ca_cert_initialized, const char *pskIdent, const char *psKey)`**: Configures SSL/TLS authentication options based on provided CA certificates or pre-shared keys. +- **`auth_client_cert_key(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key, bool *client_cert_initialized, bool *client_key_initialized)`**: Loads and initializes the client's certificate and private key for SSL/TLS authentication. +- **`set_hostname_for_tls(sslclient_context *ssl_client, const char *host)`**: Sets the hostname for the TLS session, which should match the Common Name (CN) in the server's certificate. + +## SSL Handshake and Verification +- **`perform_ssl_handshake(sslclient_context *ssl_client, const char *cli_cert, const char *cli_key)`**: Manages the SSL/TLS handshake process. +- **`verify_server_cert(sslclient_context *ssl_client)`**: Verifies the server's certificate against the provided root CA. + +## Data Transmission and Reception +- **`data_to_read(sslclient_context *ssl_client)`**: Checks if there is data available to read from the SSL connection. +- **`send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, size_t len)`**: Sends data over an established SSL connection. +- **`get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, size_t length)`**: Receives data from the SSL connection. + +## Certificate Validation +- **`verify_ssl_fingerprint(sslclient_context *ssl_client, const char* fp, const char* domain_name)`**: Verifies the certificate provided by the peer against a specified SHA256 fingerprint. +- **`verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name)`**: Checks if the peer certificate contains the specified domain name in its Common Name (CN) or Subject Alternative Names (SANs). + +## Utility Functions +- **`parse_hex_nibble(char pb, uint8_t* res)`**: Parses a hexadecimal nibble into its binary representation. +- **`match_name(const string& name, const string& domainName)`**: Compares a name from a certificate to a domain name to check if they match. + +## Cleanup and Socket Management +- **`stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key)`**: Stops the SSL socket and frees associated resources. + +This user guide provides a comprehensive overview of each function, offering insights into how to use the SSLClient library effectively for secure communication in Arduino-based projects. Each function is designed to handle specific aspects of SSL/TLS communication, from establishing connections and handling data transmission to managing certificates and ensuring security. From 027c9586d3491fac1c664255fe00c216bb755d3f Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sat, 13 Jul 2024 22:25:16 +0100 Subject: [PATCH 07/48] docs: add notes re tls versions --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d7cde62..9013fef 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, p Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFiClientSecure) for Arduino/ESP32. ## 🌟 What's New - +**Major Versions 2 and 3 of MBedTLS**: Updated to support the latest versions of the MBedTLS library. **ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. **Cert Bundles**: Simplifies management and use of multiple CA certificates. **Bug Fix**: Corrects byte calculation for record expansion post-handshake. @@ -28,7 +28,17 @@ Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/ ## ✨ Features - Secure TLS communication. -- Based on mbedtls. +- Based on **Mbed-TLS/mbedtls**. + - **Mbed TLS 2.x** + TLS Versions Supported: **Mbed TLS 2.x** supports `TLS 1.0`, `TLS 1.1`, and `TLS 1.2`. + **Specifics:** + `TLS 1.2`: Full support with a wide range of cipher suites and features. + `TLS 1.1` and `1.0`: These versions are supported, but their use is discouraged due to security vulnerabilities and weaknesses compared to `TLS 1.2`. + - **Mbed TLS 3.x** + TLS Versions Supported: **Mbed TLS 3.x** supports `TLS 1.2` and `TLS 1.3`. + **Specifics:** + `TLS 1.2`: Continues full support with extensive cipher suites and features. + `TLS 1.3`: Introduced in Mbed `TLS 3.x`, providing enhanced security features, improved performance, and simplified handshake process. - Compatible with Arduino/ESP32 and potentially other platforms. - Suitable for IoT applications, including AWS IoT. @@ -37,7 +47,7 @@ Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/ Install via the Arduino Library Manager or PlatformIO: Arduino IDE: Search for "SSLClient". -PlatformIO: Add `digitaldragon/SSLClient@^1.2.0` to platformio.ini. +PlatformIO: Add `digitaldragon/SSLClient@^1.3.0` to platformio.ini. ## 🛠Usage From 26d8be4bfd7bd952331e87b353057b1c66577d44 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 20:29:14 +0100 Subject: [PATCH 08/48] chore: Update Arduino Library Manager and PlatformIO installation instructions --- .github/workflows/pio_exaxmples.yml | 43 +++++++++++++++++++++++++++++ README.md | 15 +++++----- 2 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/pio_exaxmples.yml diff --git a/.github/workflows/pio_exaxmples.yml b/.github/workflows/pio_exaxmples.yml new file mode 100644 index 0000000..e1f3037 --- /dev/null +++ b/.github/workflows/pio_exaxmples.yml @@ -0,0 +1,43 @@ +name: Build and Test PlatformIO Examples + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + board: + - esp32dev + - esp32doit-devkit-v1 + - esp32-wrover-kit + - esp-wrover-kit + example: + - Esp32-platformIO/t-call-esp32-sim800l-alpn-protos + - Esp32-platformIO/t-call-esp32-sim800l-aws + - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install platformio + + - name: Initialise PlatformIO Project + run: | + pio project init --board ${{ matrix.board }} + working-directory: ./examples/${{ matrix.example }} + + - name: Build Example + run: | + pio run + working-directory: ./examples/${{ matrix.example }} diff --git a/README.md b/README.md index 9013fef..b75742b 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ [](#license) [](https://github.com/govorox/SSLClient/issues) -[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") - -[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") - ## 🚀 Overview SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, providing a transparent SSL/TLS layer over any **Client** class instance. Leverages *mbedtls* for robust, efficient cryptographic operations, initially tailored for ESP32 but adaptable across platforms. @@ -44,10 +40,15 @@ Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/ ## 🔧 Installation -Install via the Arduino Library Manager or PlatformIO: +Install via the Arduino Library Manager or PlatformIO plugin: + +[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") + +**Arduino IDE** - search for "SSLClient" + +[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") -Arduino IDE: Search for "SSLClient". -PlatformIO: Add `digitaldragon/SSLClient@^1.3.0` to platformio.ini. +**VSCode / PlatformIO** - add `digitaldragon/SSLClient@^1.3.0` to `platformio.ini` ## 🛠Usage From e418bce2f6c225b303a59bbc780c12f0086d95d2 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 20:52:02 +0100 Subject: [PATCH 09/48] chore: Update GitHub Actions workflow for PlatformIO examples --- .github/workflows/{pio_exaxmples.yml => pio_examples.yml} | 1 - docs/GITHUB_ACTIONS_LOCAL.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{pio_exaxmples.yml => pio_examples.yml} (97%) create mode 100644 docs/GITHUB_ACTIONS_LOCAL.md diff --git a/.github/workflows/pio_exaxmples.yml b/.github/workflows/pio_examples.yml similarity index 97% rename from .github/workflows/pio_exaxmples.yml rename to .github/workflows/pio_examples.yml index e1f3037..f8ccb27 100644 --- a/.github/workflows/pio_exaxmples.yml +++ b/.github/workflows/pio_examples.yml @@ -11,7 +11,6 @@ jobs: board: - esp32dev - esp32doit-devkit-v1 - - esp32-wrover-kit - esp-wrover-kit example: - Esp32-platformIO/t-call-esp32-sim800l-alpn-protos diff --git a/docs/GITHUB_ACTIONS_LOCAL.md b/docs/GITHUB_ACTIONS_LOCAL.md new file mode 100644 index 0000000..9f2efd7 --- /dev/null +++ b/docs/GITHUB_ACTIONS_LOCAL.md @@ -0,0 +1 @@ +`act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 -W .github/workflows/pio_examples.yml` \ No newline at end of file From 51ce5adeb60328c37a9ec9c3703a6754a1cca693 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 20:56:09 +0100 Subject: [PATCH 10/48] update SSLCLient path --- .../t-call-esp32-sim800l-alpn-protos/src/main.cpp | 2 +- examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp | 2 +- .../t-call-esp32-sim800l-cert-bundle/src/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp index c445405..c456ec3 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp @@ -1,5 +1,5 @@ #include <Arduino.h> -#include "SSLClient.h" +#include <SSLClient.h> #include <HttpClient.h> #include "ca_cert.h" #include <Wire.h> diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp index 821aac3..3bbfb5a 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp @@ -1,5 +1,5 @@ #include <Arduino.h> -#include "SSLClient.h" +#include <SSLClient.h> #include <HttpClient.h> #include <Wire.h> #include <PubSubClient.h> diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/src/main.cpp index 4d45e94..91553f6 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/src/main.cpp @@ -1,5 +1,5 @@ #include <Arduino.h> -#include "SSLClient.h" +#include <SSLClient.h> #include <Wire.h> #define MODEM_UART_BAUD 9600 From 9c77823a1393fcf4933962853b473b0d37d80666 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 21:02:18 +0100 Subject: [PATCH 11/48] chore: Fix response assignment in main.cpp --- .../t-call-esp32-sim800l-alpn-protos/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp index c456ec3..25f8012 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp @@ -148,7 +148,7 @@ void loop() { httpClient.get("/a/check"); int status_code = httpClient.responseStatusCode(); - std::string response = httpClient.responseBody(); + std::string response = httpClient.responseBody().c_str(); Serial.print("Status code: "); Serial.println(status_code); From 009df8431ec922c919fc01c88035537c586c1eb6 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 21:09:28 +0100 Subject: [PATCH 12/48] chore: Update HttpClient library to ArduinoHttpClient --- .../t-call-esp32-sim800l-alpn-protos/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp index 25f8012..717a3c7 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/src/main.cpp @@ -1,6 +1,6 @@ #include <Arduino.h> #include <SSLClient.h> -#include <HttpClient.h> +#include <ArduinoHttpClient.h> #include "ca_cert.h" #include <Wire.h> From f2cff543e218936f60f9861fe51fd39159d8f524 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 21:16:38 +0100 Subject: [PATCH 13/48] chore: Update HttpClient library to ArduinoHttpClient --- examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp index 3bbfb5a..580b167 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/src/main.cpp @@ -1,6 +1,6 @@ #include <Arduino.h> #include <SSLClient.h> -#include <HttpClient.h> +#include <ArduinoHttpClient.h> #include <Wire.h> #include <PubSubClient.h> #include <time.h> From cec8b510332a4ef340b6b1c40841a8f0f1f2f65d Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 21:56:03 +0100 Subject: [PATCH 14/48] chore: Update PlatformIO examples workflow and dependencies --- .github/workflows/pio_examples.yml | 8 ++++---- .gitignore | 3 ++- .../t-call-esp32-sim800l-aws/platformio.ini | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index f8ccb27..eb27b21 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -9,13 +9,13 @@ jobs: strategy: matrix: board: - - esp32dev - - esp32doit-devkit-v1 + # - esp32dev + # - esp32doit-devkit-v1 - esp-wrover-kit example: - Esp32-platformIO/t-call-esp32-sim800l-alpn-protos - - Esp32-platformIO/t-call-esp32-sim800l-aws - - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle + # - Esp32-platformIO/t-call-esp32-sim800l-aws + # - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index ef916ab..ebad1fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .vscode/ lib/* test.log -emulation.log \ No newline at end of file +emulation.log +compile-examples.sh \ No newline at end of file diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini index 764d5aa..6b13c16 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini @@ -17,6 +17,7 @@ lib_deps = knolleary/PubSubClient@^2.8 vshymanskyy/StreamDebugger@^1.0.1 digitaldragon/SSLClient@^1.2.0 + arduino-libraries/ArduinoHttpClient@^0.6.0 build_flags = -I include -D CORE_DEBUG_LEVEL=3 From 01cd9c7823dbc1478d666662ace8fca4720b3746 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 21:56:27 +0100 Subject: [PATCH 15/48] chore: Update PlatformIO examples workflow and dependencies --- .github/workflows/pio_examples.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index eb27b21..f8ccb27 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -9,13 +9,13 @@ jobs: strategy: matrix: board: - # - esp32dev - # - esp32doit-devkit-v1 + - esp32dev + - esp32doit-devkit-v1 - esp-wrover-kit example: - Esp32-platformIO/t-call-esp32-sim800l-alpn-protos - # - Esp32-platformIO/t-call-esp32-sim800l-aws - # - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle + - Esp32-platformIO/t-call-esp32-sim800l-aws + - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle steps: - name: Checkout code From e4e7b46d4a4e06915119b7fd2c856520c71976ed Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:29:16 +0100 Subject: [PATCH 16/48] chore: Update PlatformIO examples workflow and dependencies --- .github/workflows/pio_examples.yml | 24 ++++--------------- docs/GITHUB_ACTIONS_LOCAL.md | 1 - .../platformio.ini | 16 +++++++++++-- .../t-call-esp32-sim800l-aws/platformio.ini | 12 ++++++++-- .../platformio.ini | 23 ++++++++++++------ 5 files changed, 44 insertions(+), 32 deletions(-) delete mode 100644 docs/GITHUB_ACTIONS_LOCAL.md diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index f8ccb27..31b0109 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -5,17 +5,6 @@ on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - - strategy: - matrix: - board: - - esp32dev - - esp32doit-devkit-v1 - - esp-wrover-kit - example: - - Esp32-platformIO/t-call-esp32-sim800l-alpn-protos - - Esp32-platformIO/t-call-esp32-sim800l-aws - - Esp32-platformIO/t-call-esp32-sim800l-cert-bundle steps: - name: Checkout code @@ -25,18 +14,13 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.8' - + - name: Install PlatformIO run: | python -m pip install --upgrade pip pip install platformio - - name: Initialise PlatformIO Project - run: | - pio project init --board ${{ matrix.board }} - working-directory: ./examples/${{ matrix.example }} - - - name: Build Example + - name: Run Custom Build Script run: | - pio run - working-directory: ./examples/${{ matrix.example }} + chmod +x compile_examples.sh + ./compile_examples.sh --clean diff --git a/docs/GITHUB_ACTIONS_LOCAL.md b/docs/GITHUB_ACTIONS_LOCAL.md deleted file mode 100644 index 9f2efd7..0000000 --- a/docs/GITHUB_ACTIONS_LOCAL.md +++ /dev/null @@ -1 +0,0 @@ -`act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 -W .github/workflows/pio_examples.yml` \ No newline at end of file diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini index a36d62c..e938d23 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini @@ -8,10 +8,12 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:esp-wrover-kit] +; Default environment configuration +[env] platform = espressif32 -board = esp-wrover-kit framework = arduino + +; Additional libraries and build flags common to all environments lib_deps = vshymanskyy/TinyGSM@^0.11.7 vshymanskyy/StreamDebugger@^1.0.1 @@ -24,3 +26,13 @@ build_flags = upload_speed = 921600 monitor_speed = 115200 monitor_filters = esp32_exception_decoder, time + +; Specific environment configurations +[env:esp32dev] +board = esp32dev + +[env:esp32doit-devkit-v1] +board = esp32doit-devkit-v1 + +[env:esp-wrover-kit] +board = esp-wrover-kit diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini index 6b13c16..d61022f 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini @@ -8,9 +8,8 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:esp-wrover-kit] +[env] platform = espressif32 -board = esp-wrover-kit framework = arduino lib_deps = vshymanskyy/TinyGSM@^0.11.7 @@ -25,3 +24,12 @@ build_flags = upload_speed = 921600 monitor_speed = 115200 monitor_filters = esp32_exception_decoder, time + +[env:esp32dev] +board = esp32dev + +[env:esp32doit-devkit-v1] +board = esp32doit-devkit-v1 + +[env:esp-wrover-kit] +board = esp-wrover-kit \ No newline at end of file diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini index f24b4cb..c1577e7 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini @@ -1,14 +1,8 @@ -[env:esp-wrover-kit] +[env] platform = espressif32 board = esp-wrover-kit framework = arduino -; Microcontroller config (ESP32-WROVER-E with 4MB Flash) -board_build.f_flash = 80000000L -board_upload.flash_size = 4MB -board_upload.maximum_size = 4194304 ; 4MB in bytes -board_build.partitions = default.csv ; Adjusted to default for 4MB flash - ; Serial Monitor monitor_speed = 115200 upload_speed = 921600 @@ -29,3 +23,18 @@ board_build.embed_files = data/crt/x509_crt_bundle.bin lib_deps = vshymanskyy/TinyGSM@^0.11.7 digitaldragon/SSLClient@^1.2.0 + +[env:esp32dev] +board = esp32dev + +[env:esp32doit-devkit-v1] +board = esp32doit-devkit-v1 + +[env:esp-wrover-kit] +board = esp-wrover-kit + +; Microcontroller config (ESP32-WROVER-E with 4MB Flash) +board_build.f_flash = 80000000L +board_upload.flash_size = 4MB +board_upload.maximum_size = 4194304 ; 4MB in bytes +board_build.partitions = default.csv ; Adjusted to default for 4MB flash \ No newline at end of file From dc9e924b52548ca67713a362036a51a5a5f936ad Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:34:26 +0100 Subject: [PATCH 17/48] chore: Update PlatformIO examples workflow and dependencies --- .github/workflows/pio_examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 31b0109..8d4223c 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -19,7 +19,7 @@ jobs: run: | python -m pip install --upgrade pip pip install platformio - + - name: Run Custom Build Script run: | chmod +x compile_examples.sh From 435c945923767fdc6a4f22b413f0c71ea0bd15c2 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:36:29 +0100 Subject: [PATCH 18/48] chore: Add verification step for custom build script --- .github/workflows/pio_examples.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 8d4223c..2818cf3 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -20,6 +20,12 @@ jobs: python -m pip install --upgrade pip pip install platformio + - name: Verify Script Exists + run: | + ls -l compile_examples.sh + ls $(pwd) + echo $(pwd) + - name: Run Custom Build Script run: | chmod +x compile_examples.sh From 08cf4e8d106f6f18bd51a6cd3eef4426dc2d7d5c Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:37:15 +0100 Subject: [PATCH 19/48] chore: Remove unnecessary command in pio_examples.yml workflow --- .github/workflows/pio_examples.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 2818cf3..8e54d31 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -22,7 +22,6 @@ jobs: - name: Verify Script Exists run: | - ls -l compile_examples.sh ls $(pwd) echo $(pwd) From 9cc60adca64132325edd27df5a2a8f74b4d47b3b Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:38:16 +0100 Subject: [PATCH 20/48] chore: Remove unnecessary command in pio_examples.yml workflow --- .gitignore | 3 +- compile-examples.sh | 109 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 2 deletions(-) create mode 100755 compile-examples.sh diff --git a/.gitignore b/.gitignore index ebad1fb..ef916ab 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ .vscode/ lib/* test.log -emulation.log -compile-examples.sh \ No newline at end of file +emulation.log \ No newline at end of file diff --git a/compile-examples.sh b/compile-examples.sh new file mode 100755 index 0000000..15973ff --- /dev/null +++ b/compile-examples.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +# Set the root directory containing the example directories +ROOT_DIR=$(pwd) +CLEAN=false + +# Boards to test +BOARDS=("esp32dev" "esp32doit-devkit-v1" "esp-wrover-kit") + +# Parse command line options +while [[ "$#" -gt 0 ]]; do + case $1 in + --clean) CLEAN=true ;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac + shift +done + +# Initialize results array +declare -A RESULTS + +# Function to compile the example for a specific board +compile_example() { + local example_dir=$1 + local board=$2 + local example_name + example_name=$(basename "$example_dir") + echo "Compiling example in directory: $example_dir for board: $board" + + # Change to the example directory + cd "$example_dir" || exit 1 + + # Check if the board environment is defined in platformio.ini + if ! grep -q "\[env:$board\]" platformio.ini; then + echo "Environment for board $board not defined in $example_dir/platformio.ini" + RESULTS["$example_name,$board"]="Failed (environment not defined)" + return 1 + fi + + # Compile the example using platformio + pio run -e "$board" + + # Check if compilation was successful + if [ $? -ne 0 ]; then + echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" + RESULTS["$example_name,$board"]="Failed" + return 1 + fi + + echo "Compilation successful for $example_dir for board: $board" + RESULTS["$example_name,$board"]="Passed" +} + +# Function to clean the example +clean_example() { + local example_dir=$1 + echo "Cleaning example in directory: $example_dir" + + # Change to the example directory + cd "$example_dir" || exit 1 + + # Clean the example using platformio + if [ -f "platformio.ini" ]; then + pio run --target clean + else + echo "No recognized build system (platformio.ini) found in $example_dir" + return 1 + fi + + echo "Cleaning successful for $example_dir" + + # Remove .pio directory if --clean option is passed + if [ "$CLEAN" = true ]; then + echo "Removing .pio directory in $example_dir" + rm -rf .pio + fi + + # Return to the root directory + cd "$ROOT_DIR" || exit 1 +} + +# Remove previous log file +rm -f "$ROOT_DIR/compile_errors.log" + +# Iterate over each example directory +for example_dir in "$ROOT_DIR"/examples/Esp32-platformIO/*/; do + echo "$example_dir" + # Check if the directory contains platformio.ini + if [ -f "$example_dir/platformio.ini" ]; then + for board in "${BOARDS[@]}"; do + compile_example "$example_dir" "$board" + done + + # Clean the example after all board-specific compilations are complete + clean_example "$example_dir" + else + echo "Skipping directory $example_dir (no recognized build files)" + fi +done + +# Generate summary +echo "Compilation Summary:" +echo "====================" +for key in "${!RESULTS[@]}"; do + IFS=',' read -r example_name board <<< "$key" + echo "Example: $example_name, Board: $board, Result: ${RESULTS[$key]}" +done + +echo "All examples processed. Check compile_errors.log for any compilation errors." From a7cacb72b7dde8efebbe0212e77a99c28273097e Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:39:20 +0100 Subject: [PATCH 21/48] chore: Update pio_examples.yml workflow to include verbose directory listing --- .github/workflows/pio_examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 8e54d31..c7863b1 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -22,7 +22,7 @@ jobs: - name: Verify Script Exists run: | - ls $(pwd) + ls -lah $(pwd) echo $(pwd) - name: Run Custom Build Script From 7cec135caabcc2548cffa348ae882f363d4f206a Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:41:40 +0100 Subject: [PATCH 22/48] chore: Update pio_examples.yml workflow to include verbose directory listing --- .github/workflows/pio_examples.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index c7863b1..70a7864 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -23,7 +23,8 @@ jobs: - name: Verify Script Exists run: | ls -lah $(pwd) - echo $(pwd) + which sh + which bash - name: Run Custom Build Script run: | From b446b985c1a4d31bf560513cbd26fcfc24629df5 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:42:24 +0100 Subject: [PATCH 23/48] chore: Update shebang in compile-examples.sh to use /usr/bin/bash --- compile-examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile-examples.sh b/compile-examples.sh index 15973ff..8b15cb8 100755 --- a/compile-examples.sh +++ b/compile-examples.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/bash # Set the root directory containing the example directories ROOT_DIR=$(pwd) From 62e8e5494997313cbbda0cf79605a5f84bf27570 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:43:44 +0100 Subject: [PATCH 24/48] chore: Update pio_examples.yml workflow to remove unnecessary command --- .github/workflows/pio_examples.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 70a7864..db12c4c 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -28,5 +28,4 @@ jobs: - name: Run Custom Build Script run: | - chmod +x compile_examples.sh ./compile_examples.sh --clean From cb579a0764371e2ff91bf20505a552bed9d3107a Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:45:03 +0100 Subject: [PATCH 25/48] chore: Update compile-examples.sh script name in pio_examples.yml workflow --- .github/workflows/pio_examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index db12c4c..d2ec6e2 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -28,4 +28,4 @@ jobs: - name: Run Custom Build Script run: | - ./compile_examples.sh --clean + ./compile-examples.sh --clean From 1bfc02c81d53c435a5b59649a015b931cf41ccc5 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:50:14 +0100 Subject: [PATCH 26/48] chore: Update compile-examples.sh script name and shebang in pio_examples.yml workflow --- .github/workflows/pio_examples.yml | 10 ++-------- .../workflows/scripts/compile-examples.sh | 0 2 files changed, 2 insertions(+), 8 deletions(-) rename compile-examples.sh => .github/workflows/scripts/compile-examples.sh (100%) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index d2ec6e2..686c188 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -20,12 +20,6 @@ jobs: python -m pip install --upgrade pip pip install platformio - - name: Verify Script Exists + - name: Compile Examples run: | - ls -lah $(pwd) - which sh - which bash - - - name: Run Custom Build Script - run: | - ./compile-examples.sh --clean + ./.github/workflows/compile-examples.sh --clean diff --git a/compile-examples.sh b/.github/workflows/scripts/compile-examples.sh similarity index 100% rename from compile-examples.sh rename to .github/workflows/scripts/compile-examples.sh From 1ee33c09f3328ee990f2ac5424f7d8f2b9dfa417 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Sun, 14 Jul 2024 22:51:58 +0100 Subject: [PATCH 27/48] chore: Update compile-examples.sh script path in pio_examples.yml workflow --- .github/workflows/pio_examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 686c188..026c17e 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -22,4 +22,4 @@ jobs: - name: Compile Examples run: | - ./.github/workflows/compile-examples.sh --clean + ./.github/workflows/scripts/compile-examples.sh --clean From 495e45647259bc4a34ca91aa83dd01059bdd4017 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 16:54:56 +0100 Subject: [PATCH 28/48] chore: Update library version to 1.3.0 and add compile_errors.log to .gitignore --- .github/workflows/arduino_examples.yml | 39 ++++++++ .github/workflows/pio_examples.yml | 4 +- .../scripts/compile_arduino_examples.sh | 97 +++++++++++++++++++ ...le-examples.sh => compile_pio_examples.sh} | 0 .../scripts/install_sslclient_for_testing.sh | 25 +++++ .gitignore | 3 +- library.json | 2 +- library.properties | 2 +- 8 files changed, 167 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/arduino_examples.yml create mode 100755 .github/workflows/scripts/compile_arduino_examples.sh rename .github/workflows/scripts/{compile-examples.sh => compile_pio_examples.sh} (100%) create mode 100755 .github/workflows/scripts/install_sslclient_for_testing.sh diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml new file mode 100644 index 0000000..d48bb0f --- /dev/null +++ b/.github/workflows/arduino_examples.yml @@ -0,0 +1,39 @@ +name: Build Arduino Examples + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install Arduino CLI + uses: arduino/setup-arduino-cli@v2 + + - name: Install Arduino Cores + run: | + arduino-cli config init + arduino-cli core update-index + arduino-cli core install arduino:avr + arduino-cli core install esp32:esp32 + + - name: Install libs + run: | + arduino-cli lib install "Ethernet" + arduino-cli lib install "GovoroxSSLClient" + arduino-cli lib install "WiFi" + arduino-cli lib install "ArduinoHttpClient" + arduino-cli lib install "PubSubClient" + arduino-cli lib install "TinyGSM" + + - name: Compile Examples + run: | + ./.github/workflows/scripts/compile_arduino_examples.sh --clean diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index 026c17e..c142b58 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -1,4 +1,4 @@ -name: Build and Test PlatformIO Examples +name: Build PlatformIO Examples on: [push, pull_request] @@ -22,4 +22,4 @@ jobs: - name: Compile Examples run: | - ./.github/workflows/scripts/compile-examples.sh --clean + ./.github/workflows/scripts/compile_pio_examples.sh --clean diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh new file mode 100755 index 0000000..a8dfb33 --- /dev/null +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -0,0 +1,97 @@ +#!/usr/bin/bash + +# Set the root directory containing the example directories +ROOT_DIR=$(pwd) +CLEAN=false + +# Boards to test +BOARDS=("arduino:avr:uno" "esp32:esp32:esp32doit-devkit-v1" "esp32:esp32:esp32wroverkit") + +# Parse command line options +while [[ "$#" -gt 0 ]]; do + case $1 in + --clean) CLEAN=true ;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac + shift +done + +# Initialize results array +declare -A RESULTS + +# Function to compile the example for a specific board +compile_example() { + local example_dir=$1 + local board=$2 + local example_name + example_name=$(basename "$example_dir") + echo "Compiling example in directory: $example_dir for board: $board" + + # Change to the example directory + cd "$example_dir" || exit 1 + + # Compile the example using arduino-cli + arduino-cli compile --fqbn "$board" . || { + echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" + RESULTS["$example_name,$board"]="Failed" + return 1 + } + + echo "Compilation successful for $example_dir for board: $board" + RESULTS["$example_name,$board"]="Passed" +} + +# Function to clean the example +clean_example() { + local example_dir=$1 + echo "Cleaning example in directory: $example_dir" + + # Change to the example directory + cd "$example_dir" || exit 1 + + # Clean the example using arduino-cli + arduino-cli cache clean || { + echo "Cleaning failed for $example_dir" + return 1 + } + + echo "Cleaning successful for $example_dir" + + # Remove build directory if --clean option is passed + if [ "$CLEAN" = true ]; then + echo "Removing build directory in $example_dir" + rm -rf build + fi + + # Return to the root directory + cd "$ROOT_DIR" || exit 1 +} + +# Remove previous log file +rm -f "$ROOT_DIR/compile_errors.log" + +# Iterate over each example directory +for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do + echo "$example_dir" + # Check if the directory contains a .ino file + if [ -f "$example_dir"/*.ino ]; then + for board in "${BOARDS[@]}"; do + compile_example "$example_dir" "$board" + done + + # Clean the example after all board-specific compilations are complete + clean_example "$example_dir" + else + echo "Skipping directory $example_dir (no .ino file found)" + fi +done + +# Generate summary +echo "Compilation Summary:" +echo "====================" +for key in "${!RESULTS[@]}"; do + IFS=',' read -r example_name board <<< "$key" + echo "Example: $example_name, Board: $board, Result: ${RESULTS[$key]}" +done + +echo "All examples processed. Check compile_errors.log for any compilation errors." diff --git a/.github/workflows/scripts/compile-examples.sh b/.github/workflows/scripts/compile_pio_examples.sh similarity index 100% rename from .github/workflows/scripts/compile-examples.sh rename to .github/workflows/scripts/compile_pio_examples.sh diff --git a/.github/workflows/scripts/install_sslclient_for_testing.sh b/.github/workflows/scripts/install_sslclient_for_testing.sh new file mode 100755 index 0000000..39ed04c --- /dev/null +++ b/.github/workflows/scripts/install_sslclient_for_testing.sh @@ -0,0 +1,25 @@ +#!/usr/bin/bash + +# Remove existing SSLClient directory to avoid conflicts +rm -rf ~/SSLClient + +# Clone the repository +git clone https://github.com/govorox/SSLClient.git ~/SSLClient +cd ~/SSLClient + +# Checkout the desired branch +git checkout v1.3.0 # Use the correct branch name if different + +# Ensure correct structure +mkdir -p SSLClient # Create the directory for the library files +mv LICENSE README.md docs examples library.json library.properties platformio.ini src test SSLClient/ + +# Compress the directory +zip -r SSLClient.zip SSLClient + +# Enable unsafe installs in Arduino CLI configuration +mkdir -p ~/.arduino15 +echo -e "library:\n enable_unsafe_install: true" > ~/.arduino15/arduino-cli.yaml + +# Install the library using Arduino CLI +arduino-cli lib install --config-file ~/.arduino15/arduino-cli.yaml --zip-path SSLClient.zip diff --git a/.gitignore b/.gitignore index ef916ab..737c6d0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .vscode/ lib/* test.log -emulation.log \ No newline at end of file +emulation.log +compile_errors.log \ No newline at end of file diff --git a/library.json b/library.json index 416f122..26d7ca1 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SSLClient", - "version": "1.2.0", + "version": "1.3.0", "repository": { "type": "git", diff --git a/library.properties b/library.properties index 98104a9..e8690b7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GovoroxSSLClient -version=1.2.0 +version=1.3.0 author=V Govorovski maintainer=Robert Byrnes <robbyrnes@hotmail.co.uk> sentence=Provides secure network connection over a generic Client transport object. From 95061ddd51525cd101fd743818493515806a8978 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 17:45:07 +0100 Subject: [PATCH 29/48] update certs in arduino examples --- .../scripts/compile_arduino_examples.sh | 2 +- .../scripts/install_sslclient_for_testing.sh | 2 +- .../https_eth_LilyGo-T-ETH-POE/ca_cert.h | 49 +++++++------ .../https_eth_LilyGo-T-ETH-POE.ino | 5 ++ .../https_gsm_SIM7000/ca_cert.h | 49 +++++++------ .../https_get_sim7600/certs.h | 55 ++++++++------- .../https_post_sim7600/certs.h | 51 ++++++++------ .../https_gsm_SIM800/ca_cert.h | 49 +++++++------ .../Esp32-Arduino-IDE/https_wifi/ca_cert.h | 49 +++++++------ .../ca_cert.h | 68 ++++++++----------- ...qtt_gsm_SIM800L_Azure_x509_Device_Twin.ino | 2 +- .../mqtt_secure_gsm_SIM7000/ca_cert.h | 64 ++++++++--------- .../mqtt_secure_gsm_SIM7000.ino | 2 +- test/mocks/TestClient.h | 2 +- 14 files changed, 242 insertions(+), 207 deletions(-) diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index a8dfb33..61a8ce1 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -5,7 +5,7 @@ ROOT_DIR=$(pwd) CLEAN=false # Boards to test -BOARDS=("arduino:avr:uno" "esp32:esp32:esp32doit-devkit-v1" "esp32:esp32:esp32wroverkit") +BOARDS=("esp32:esp32:esp32doit-devkit-v1" "esp32:esp32:esp32wroverkit") # Parse command line options while [[ "$#" -gt 0 ]]; do diff --git a/.github/workflows/scripts/install_sslclient_for_testing.sh b/.github/workflows/scripts/install_sslclient_for_testing.sh index 39ed04c..e8b924c 100755 --- a/.github/workflows/scripts/install_sslclient_for_testing.sh +++ b/.github/workflows/scripts/install_sslclient_for_testing.sh @@ -12,7 +12,7 @@ git checkout v1.3.0 # Use the correct branch name if different # Ensure correct structure mkdir -p SSLClient # Create the directory for the library files -mv LICENSE README.md docs examples library.json library.properties platformio.ini src test SSLClient/ +mv LICENCE library.properties src SSLClient/ # Compress the directory zip -r SSLClient.zip SSLClient diff --git a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/ca_cert.h b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/ca_cert.h index 3d79d4a..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/ca_cert.h @@ -1,22 +1,31 @@ -//CA Certificate for www.howsmyssl.com (valid until 04-07-2021) +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n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fmh0dHA6Ly94MS5pLmxlbmNyLm9yZy8wEwYDVR0gBAwwCjAIBgZngQwBAgEwJwYD\n" +"VR0fBCAwHjAcoBqgGIYWaHR0cDovL3gxLmMubGVuY3Iub3JnLzANBgkqhkiG9w0B\n" +"AQsFAAOCAgEAkrHnQTfreZ2B5s3iJeE6IOmQRJWjgVzPw139vaBw1bGWKCIL0vIo\n" +"zwzn1OZDjCQiHcFCktEJr59L9MhwTyAWsVrdAfYf+B9haxQnsHKNY67u4s5Lzzfd\n" +"u6PUzeetUK29v+PsPmI2cJkxp+iN3epi4hKu9ZzUPSwMqtCceb7qPVxEbpYxY1p9\n" +"1n5PJKBLBX9eb9LU6l8zSxPWV7bK3lG4XaMJgnT9x3ies7msFtpKK5bDtotij/l0\n" +"GaKeA97pb5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh\n" +"1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ\n" +"QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino index 225d292..a784312 100644 --- a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino +++ b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino @@ -9,7 +9,12 @@ * Base example: https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE/blob/master/example/eth/eth.ino * **************************************************************/ +#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3,0,0) +#include <ETHClass2.h> //Is to use the modified ETHClass +#define ETH ETH2 +#else #include <ETH.h> +#endif #include "WiFi.h" #include "SSLClient.h" //To make http request esay: https://github.com/arduino-libraries/ArduinoHttpClient diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7000/ca_cert.h b/examples/Esp32-Arduino-IDE/https_gsm_SIM7000/ca_cert.h index 3d79d4a..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM7000/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/https_gsm_SIM7000/ca_cert.h @@ -1,22 +1,31 @@ -//CA Certificate for www.howsmyssl.com (valid until 04-07-2021) +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" -"DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\n" -"PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\n" -"Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" -"AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\n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1n5PJKBLBX9eb9LU6l8zSxPWV7bK3lG4XaMJgnT9x3ies7msFtpKK5bDtotij/l0\n" +"GaKeA97pb5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh\n" +"1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ\n" +"QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h b/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h index 72451b2..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h +++ b/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h @@ -1,28 +1,31 @@ -// Root CA for vsh.pp.ua +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIEZTCCA02gAwIBAgIQQAF1BIMUpMghjISpDBbN3zANBgkqhkiG9w0BAQsFADA/\n" -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" -"DkRTVCBSb290IENBIFgzMB4XDTIwMTAwNzE5MjE0MFoXDTIxMDkyOTE5MjE0MFow\n"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ohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h b/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h index 442c2fd..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h +++ b/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h @@ -1,24 +1,31 @@ -// Root CA for vsh.pp.ua +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----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//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b5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh\n" +"1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ\n" +"QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ca_cert.h b/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ca_cert.h index 3d79d4a..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ca_cert.h @@ -1,22 +1,31 @@ -//CA Certificate for www.howsmyssl.com (valid until 04-07-2021) +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" -"DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\n" -"PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\n" -"Ew5EU1QgUm9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cFCktEJr59L9MhwTyAWsVrdAfYf+B9haxQnsHKNY67u4s5Lzzfd\n" +"u6PUzeetUK29v+PsPmI2cJkxp+iN3epi4hKu9ZzUPSwMqtCceb7qPVxEbpYxY1p9\n" +"1n5PJKBLBX9eb9LU6l8zSxPWV7bK3lG4XaMJgnT9x3ies7msFtpKK5bDtotij/l0\n" +"GaKeA97pb5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh\n" +"1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ\n" +"QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/https_wifi/ca_cert.h b/examples/Esp32-Arduino-IDE/https_wifi/ca_cert.h index 3d79d4a..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/https_wifi/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/https_wifi/ca_cert.h @@ -1,22 +1,31 @@ -//CA Certificate for www.howsmyssl.com (valid until 04-07-2021) +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" -"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUc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wCjAIBgZngQwBAgEwJwYD\n" +"VR0fBCAwHjAcoBqgGIYWaHR0cDovL3gxLmMubGVuY3Iub3JnLzANBgkqhkiG9w0B\n" +"AQsFAAOCAgEAkrHnQTfreZ2B5s3iJeE6IOmQRJWjgVzPw139vaBw1bGWKCIL0vIo\n" +"zwzn1OZDjCQiHcFCktEJr59L9MhwTyAWsVrdAfYf+B9haxQnsHKNY67u4s5Lzzfd\n" +"u6PUzeetUK29v+PsPmI2cJkxp+iN3epi4hKu9ZzUPSwMqtCceb7qPVxEbpYxY1p9\n" +"1n5PJKBLBX9eb9LU6l8zSxPWV7bK3lG4XaMJgnT9x3ies7msFtpKK5bDtotij/l0\n" +"GaKeA97pb5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh\n" +"1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ\n" +"QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h index cf61a75..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h @@ -1,41 +1,31 @@ -//Azure Baltimore Certificate +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = -"-----BEGIN CERTIFICATE-----\r\n" -"MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ\r\n" -"RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD\r\n" -"VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX\r\n" -"DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y\r\n" -"ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy\r\n" -"VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr\r\n" -"mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr\r\n" -"IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK\r\n" -"mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu\r\n" -"XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy\r\n" -"dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye\r\n" -"jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1\r\n" -"BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3\r\n" -"DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92\r\n" -"9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx\r\n" -"jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0\r\n" -"Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz\r\n" -"ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\r\n" -"R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\r\n" -"-----END CERTIFICATE-----\r\n"; - - - -//Client Certificate (from Azure Iot Hub Device) - Get your own -const char client_cert_pem_start[] = -"-----BEGIN CERTIFICATE-----""\n" -"MIIFfDCCA2SgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAqMSgwJgYDVQQDDB9BenVy""\n" -... -"+sDPud5VrLd8jOWCAKcuZA==""\n" +"-----BEGIN CERTIFICATE-----\n" +"MIIFBTCCAu2gAwIBAgIQS6hSk/eaL6JzBkuoBI110DANBgkqhkiG9w0BAQsFADBP\n" +"MQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFy\n" +"Y2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMTAeFw0yNDAzMTMwMDAwMDBa\n" +"Fw0yNzAzMTIyMzU5NTlaMDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBF\n" +"bmNyeXB0MQwwCgYDVQQDEwNSMTAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" +"AoIBAQDPV+XmxFQS7bRH/sknWHZGUCiMHT6I3wWd1bUYKb3dtVq/+vbOo76vACFL\n" +"YlpaPAEvxVgD9on/jhFD68G14BQHlo9vH9fnuoE5C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ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N\n" +"4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz\n" +"rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei\n" +"RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" "-----END CERTIFICATE-----"; - -//Client Key (from Azure Iot Hub Device) - Get your own -const char client_key_pem_start[] = -"-----BEGIN RSA PRIVATE KEY-----""\n" -"MIIJKAIBAAKCAgEAwUG+ZPQp4ZRlvI7xPQYDHkLs5dTX0LTB0tUr3O7LSwc4PPf3""\n" -... -"63IPOMRIsakwx3hdRv9gh30bh6LVS6pn9UyHM65pNVsCu4OHB/B4dSiiceM=""\n" -"-----END RSA PRIVATE KEY-----"; diff --git a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino index 8cc5404..556b773 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino +++ b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino @@ -104,7 +104,7 @@ bool setupPMU() } // For read the MQTT events -void callback(char *topic, byte *payload, unsigned int length) +void callback(char *topic, uint8_t *payload, unsigned int length) { Serial.print("Message arrived ["); Serial.print(topic); diff --git a/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/ca_cert.h b/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/ca_cert.h index ce4c84d..14395d3 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/ca_cert.h @@ -1,37 +1,31 @@ -//Crt for EMQX Free Secure Broker -//https://www.emqx.io/mqtt/public-mqtt5-broker +//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) const char root_ca[] PROGMEM = "-----BEGIN CERTIFICATE-----\n" -"MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB\n" -"iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl\n" -"cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV\n" -"BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw\n" -"MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV\n" -"BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU\n" -"aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy\n" -"dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK\n" -"AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B\n" -"3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY\n" -"tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD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un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx\n" +"KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=\n" +"-----END CERTIFICATE-----"; diff --git a/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/mqtt_secure_gsm_SIM7000.ino b/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/mqtt_secure_gsm_SIM7000.ino index 5c82045..b235730 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/mqtt_secure_gsm_SIM7000.ino +++ b/examples/Esp32-Arduino-IDE/mqtt_secure_gsm_SIM7000/mqtt_secure_gsm_SIM7000.ino @@ -61,7 +61,7 @@ SSLClient secure_presentation_layer(&gsm_transpor_layer); PubSubClient client(secure_presentation_layer); // For read the MQTT events -void callback(char *topic, byte *payload, unsigned int length) +void callback(char *topic, uint8_t *payload, unsigned int length) { Serial.print("Message arrived ["); Serial.print(topic); diff --git a/test/mocks/TestClient.h b/test/mocks/TestClient.h index eaba844..58e22b3 100644 --- a/test/mocks/TestClient.h +++ b/test/mocks/TestClient.h @@ -18,7 +18,7 @@ class TestClient : public Client, public Emulator { return this->mock<int>("connect"); } - size_t write(uint8_t byte) override { + size_t write(uint8_t a_byte_) override { return this->mock<size_t>("write"); } From cbc8d3cb2ac2d792fc102f41b45807d9caed6d9c Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 20:09:31 +0100 Subject: [PATCH 30/48] test remove algorithm and string from ssl__client.cpp --- .../https_eth_LilyGo-T-ETH-POE.ino | 1 + src/ssl__client.cpp | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino index a784312..920cb02 100644 --- a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino +++ b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino @@ -9,6 +9,7 @@ * Base example: https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE/blob/master/example/eth/eth.ino * **************************************************************/ +#include "compat.h" #if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3,0,0) #include <ETHClass2.h> //Is to use the modified ETHClass #define ETH ETH2 diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index 3a4d28c..84114ea 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -8,14 +8,9 @@ */ #include "Arduino.h" -#include <algorithm> -#include <string> #include "ssl__client.h" #include "certBundle.h" -//#define ARDUHAL_LOG_LEVEL 5 -//#include <esp32-hal-log.h> - #if !defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) # error "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher" #endif From 73be4c1edab1f8a78332dc3fdfbf987ac5954582 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 20:10:51 +0100 Subject: [PATCH 31/48] chore: Update library version to 1.3.0-rc1 in library.json and library.properties --- library.json | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 26d7ca1..7634273 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SSLClient", - "version": "1.3.0", + "version": "1.3.0-rc1", "repository": { "type": "git", diff --git a/library.properties b/library.properties index e8690b7..530b6da 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GovoroxSSLClient -version=1.3.0 +version=1.3.0-rc1 author=V Govorovski maintainer=Robert Byrnes <robbyrnes@hotmail.co.uk> sentence=Provides secure network connection over a generic Client transport object. From 2fa3fcf0bf136814417c8d8b44670d2c738b5c69 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 20:12:01 +0100 Subject: [PATCH 32/48] fix: remove compat.h include --- .../https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino index 920cb02..a784312 100644 --- a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino +++ b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino @@ -9,7 +9,6 @@ * Base example: https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE/blob/master/example/eth/eth.ino * **************************************************************/ -#include "compat.h" #if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3,0,0) #include <ETHClass2.h> //Is to use the modified ETHClass #define ETH ETH2 From bfbbc5e0aa5fa71721ad76c994aeace111680c0b Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Mon, 15 Jul 2024 22:24:48 +0100 Subject: [PATCH 33/48] chore: Update Arduino library dependencies and remove unused code --- .github/workflows/arduino_examples.yml | 1 - .github/workflows/scripts/compile_arduino_examples.sh | 3 ++- .../t-call-esp32-sim800l-alpn-protos/platformio.ini | 3 ++- .../Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini | 3 ++- .../t-call-esp32-sim800l-cert-bundle/platformio.ini | 3 ++- src/SSLClient.cpp | 2 +- src/SSLClient.h | 4 +++- src/ssl__client.cpp | 5 +++-- 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index d48bb0f..6a36a20 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -27,7 +27,6 @@ jobs: - name: Install libs run: | - arduino-cli lib install "Ethernet" arduino-cli lib install "GovoroxSSLClient" arduino-cli lib install "WiFi" arduino-cli lib install "ArduinoHttpClient" diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 61a8ce1..4d4f53e 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -31,7 +31,8 @@ compile_example() { cd "$example_dir" || exit 1 # Compile the example using arduino-cli - arduino-cli compile --fqbn "$board" . || { + # arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { + arduino-cli compile --clean --fqbn "$board" . || { echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" RESULTS["$example_name,$board"]="Failed" return 1 diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini index e938d23..ed68aed 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-alpn-protos/platformio.ini @@ -17,7 +17,8 @@ framework = arduino lib_deps = vshymanskyy/TinyGSM@^0.11.7 vshymanskyy/StreamDebugger@^1.0.1 - digitaldragon/SSLClient@^1.2.0 + ; digitaldragon/SSLClient@^1.2.0 + https://github.com/govorox/SSLClient#v1.3.0 arduino-libraries/ArduinoHttpClient@^0.6.0 build_flags = -I include diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini index d61022f..58e4201 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-aws/platformio.ini @@ -15,7 +15,8 @@ lib_deps = vshymanskyy/TinyGSM@^0.11.7 knolleary/PubSubClient@^2.8 vshymanskyy/StreamDebugger@^1.0.1 - digitaldragon/SSLClient@^1.2.0 + ; digitaldragon/SSLClient@^1.2.0 + https://github.com/govorox/SSLClient#v1.3.0 arduino-libraries/ArduinoHttpClient@^0.6.0 build_flags = -I include diff --git a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini index c1577e7..1d75d98 100644 --- a/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini +++ b/examples/Esp32-platformIO/t-call-esp32-sim800l-cert-bundle/platformio.ini @@ -22,7 +22,8 @@ board_build.embed_files = data/crt/x509_crt_bundle.bin ; External libraries lib_deps = vshymanskyy/TinyGSM@^0.11.7 - digitaldragon/SSLClient@^1.2.0 + ; digitaldragon/SSLClient@^1.2.0 + https://github.com/govorox/SSLClient#v1.3.0 [env:esp32dev] board = esp32dev diff --git a/src/SSLClient.cpp b/src/SSLClient.cpp index dae9ae8..3a681fa 100644 --- a/src/SSLClient.cpp +++ b/src/SSLClient.cpp @@ -18,7 +18,7 @@ #include "SSLClient.h" #include "certBundle.h" -#include <errno.h> +// #include <errno.h> #undef connect #undef write diff --git a/src/SSLClient.h b/src/SSLClient.h index fc5b711..c795762 100644 --- a/src/SSLClient.h +++ b/src/SSLClient.h @@ -18,7 +18,9 @@ #ifndef SSLCLIENT_H #define SSLCLIENT_H -#include "Arduino.h" +#ifdef PLATFORMIO +#include <Arduino.h> +#endif #include "IPAddress.h" #include "ssl__client.h" diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index 84114ea..bd8a674 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -6,8 +6,9 @@ * Additions Copyright (C) 2017 Evandro Luis Copercini, Apache 2.0 License. * Additions Copyright (C) 2019 Vadim Govorovski. */ - -#include "Arduino.h" +#ifdef PLATFORMIO +#include <Arduino.h> +#endif #include "ssl__client.h" #include "certBundle.h" From eaee12119a86051f8d9f90b0c0b64128380d53d0 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Tue, 16 Jul 2024 21:21:07 +0100 Subject: [PATCH 34/48] fix: log_ fix --- .../scripts/compile_arduino_examples.sh | 32 +++++----- src/SSLClient.h | 3 + src/certBundle.h | 2 + src/log_.h | 61 +++++++++++++++++++ 4 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 src/log_.h diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 4d4f53e..4ed18f0 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -32,7 +32,7 @@ compile_example() { # Compile the example using arduino-cli # arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { - arduino-cli compile --clean --fqbn "$board" . || { + arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" RESULTS["$example_name,$board"]="Failed" return 1 @@ -71,21 +71,23 @@ clean_example() { # Remove previous log file rm -f "$ROOT_DIR/compile_errors.log" +compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ "esp32:esp32:esp32doit-devkit-v1" + # Iterate over each example directory -for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do - echo "$example_dir" - # Check if the directory contains a .ino file - if [ -f "$example_dir"/*.ino ]; then - for board in "${BOARDS[@]}"; do - compile_example "$example_dir" "$board" - done - - # Clean the example after all board-specific compilations are complete - clean_example "$example_dir" - else - echo "Skipping directory $example_dir (no .ino file found)" - fi -done +# for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do +# echo "$example_dir" +# # Check if the directory contains a .ino file +# if [ -f "$example_dir"/*.ino ]; then +# for board in "${BOARDS[@]}"; do +# compile_example "$example_dir" "$board" +# done + +# # Clean the example after all board-specific compilations are complete +# clean_example "$example_dir" +# else +# echo "Skipping directory $example_dir (no .ino file found)" +# fi +# done # Generate summary echo "Compilation Summary:" diff --git a/src/SSLClient.h b/src/SSLClient.h index c795762..0a6b5c1 100644 --- a/src/SSLClient.h +++ b/src/SSLClient.h @@ -18,6 +18,9 @@ #ifndef SSLCLIENT_H #define SSLCLIENT_H + +#include "log_.h" + #ifdef PLATFORMIO #include <Arduino.h> #endif diff --git a/src/certBundle.h b/src/certBundle.h index 43ba563..fe9e19b 100644 --- a/src/certBundle.h +++ b/src/certBundle.h @@ -16,6 +16,8 @@ #ifndef CERT_BUNDLE_H #define CERT_BUNDLE_H +#include "log_.h" + #ifndef SSL_CLIENT_TEST_ENVIRONMENT #include "mbedtls/ssl.h" #else diff --git a/src/log_.h b/src/log_.h new file mode 100644 index 0000000..2834bd2 --- /dev/null +++ b/src/log_.h @@ -0,0 +1,61 @@ +/** + * @file log_.h + * @brief Log levels and macros + * @details This file contains the log levels and macros for logging. + * These exist to enable the library to used in different environments, + * namely the ESP-IDF and the Arduino framework. + */ +#ifndef LOG__H_ +#define LOG__H_ + +#include <Arduino.h> + +#ifndef LOG_LEVEL_NONE +#define LOG_LEVEL_NONE 0 +#endif + +#ifndef LOG_LEVEL_ERROR +#define LOG_LEVEL_ERROR 1 +#endif + +#ifndef LOG_LEVEL_WARN +#define LOG_LEVEL_WARN 2 +#endif + +#ifndef LOG_LEVEL_INFO +#define LOG_LEVEL_INFO 3 +#endif + +#ifndef LOG_LEVEL_DEBUG +#define LOG_LEVEL_DEBUG 4 +#endif + +#ifndef LOG_LEVEL_VERBOSE +#define LOG_LEVEL_VERBOSE 5 +#endif + +#ifndef LOG_LEVEL +#define LOG_LEVEL LOG_LEVEL_VERBOSE // Change this to set the log level +#endif + +#ifndef log_e +#define log_e(...) if (LOG_LEVEL >= LOG_LEVEL_ERROR) { Serial.printf("E ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } +#endif + +#ifndef log_w +#define log_w(...) if (LOG_LEVEL >= LOG_LEVEL_WARN) { Serial.printf("W ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } +#endif + +#ifndef log_i +#define log_i(...) if (LOG_LEVEL >= LOG_LEVEL_INFO) { Serial.printf("I ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } +#endif + +#ifndef log_d +#define log_d(...) if (LOG_LEVEL >= LOG_LEVEL_DEBUG) { Serial.printf("D ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } +#endif + +#ifndef log_v +#define log_v(...) if (LOG_LEVEL >= LOG_LEVEL_VERBOSE) { Serial.printf("V ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } +#endif + +#endif // LOG__H_ \ No newline at end of file From c07b860ed5aa0168b2763dd72af5e27190740fd7 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Tue, 16 Jul 2024 21:35:45 +0100 Subject: [PATCH 35/48] chore: Update Arduino CLI utility script to include ESP32-Arduino version switching functionality --- .../scripts/compile_arduino_examples.sh | 2 +- .../scripts/test_arduino_platform.sh | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100755 .github/workflows/scripts/test_arduino_platform.sh diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 4ed18f0..67bead3 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -32,7 +32,7 @@ compile_example() { # Compile the example using arduino-cli # arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { - arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { + arduino-cli compile --clean --fqbn "$board" . || { echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" RESULTS["$example_name,$board"]="Failed" return 1 diff --git a/.github/workflows/scripts/test_arduino_platform.sh b/.github/workflows/scripts/test_arduino_platform.sh new file mode 100755 index 0000000..ba73343 --- /dev/null +++ b/.github/workflows/scripts/test_arduino_platform.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Function to list installed libraries +list_installed_libs() { + echo "Listing installed libraries..." + arduino-cli lib list +} + +# Function to list installed platforms +list_installed_platforms() { + echo "Listing installed platforms..." + arduino-cli core list +} + +# Function to list installed frameworks for boards +list_installed_frameworks() { + echo "Listing installed frameworks for boards..." + arduino-cli board listall +} + +# Function to switch to a specific ESP32-Arduino version +switch_esp32_version() { + local version=$1 + echo "Switching to ESP32-Arduino version $version..." + arduino-cli core install esp32:esp32@$version + arduino-cli core upgrade esp32:esp32@$version +} + +# Check if arduino-cli is installed +if ! command -v arduino-cli &> /dev/null; then + echo "arduino-cli could not be found, please install it first." + exit 1 +fi + +# Main script +echo "Arduino CLI Utility Script" +echo "1. List installed libraries" +echo "2. List installed platforms" +echo "3. List installed frameworks for boards" +echo "4. Switch ESP32-Arduino version" +echo "5. Exit" + +while true; do + read -p "Please select an option (1-5): " option + case $option in + 1) + list_installed_libs + ;; + 2) + list_installed_platforms + ;; + 3) + list_installed_frameworks + ;; + 4) + read -p "Enter the ESP32-Arduino version to switch to (e.g., 2.0.17 or 3.0.0): " version + switch_esp32_version $version + ;; + 5) + echo "Exiting..." + exit 0 + ;; + *) + echo "Invalid option, please try again." + ;; + esac +done From 7d39e5b6b56e903ad1fb658eb51ded317c381594 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Tue, 16 Jul 2024 21:37:08 +0100 Subject: [PATCH 36/48] Update ESP32-Arduino version switching functionality in Arduino CLI utility script --- .github/workflows/scripts/test_arduino_platform.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scripts/test_arduino_platform.sh b/.github/workflows/scripts/test_arduino_platform.sh index ba73343..0d1b816 100755 --- a/.github/workflows/scripts/test_arduino_platform.sh +++ b/.github/workflows/scripts/test_arduino_platform.sh @@ -23,7 +23,6 @@ switch_esp32_version() { local version=$1 echo "Switching to ESP32-Arduino version $version..." arduino-cli core install esp32:esp32@$version - arduino-cli core upgrade esp32:esp32@$version } # Check if arduino-cli is installed From 5192433fb8c70f34c0e0f03a4a1e3ad9763042bf Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Tue, 16 Jul 2024 21:46:24 +0100 Subject: [PATCH 37/48] chore: Update ESP32-Arduino core to version 2.0.17 --- .github/workflows/arduino_examples.yml | 2 +- .../scripts/compile_arduino_examples.sh | 31 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 6a36a20..5dfde65 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -23,7 +23,7 @@ jobs: arduino-cli config init arduino-cli core update-index arduino-cli core install arduino:avr - arduino-cli core install esp32:esp32 + arduino-cli core install esp32:esp32@2.0.17 - name: Install libs run: | diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 67bead3..5358ca0 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -31,7 +31,6 @@ compile_example() { cd "$example_dir" || exit 1 # Compile the example using arduino-cli - # arduino-cli compile --build-property "compiler.cpp.extra_flags=-E -H" --clean --fqbn "$board" . || { arduino-cli compile --clean --fqbn "$board" . || { echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" RESULTS["$example_name,$board"]="Failed" @@ -71,23 +70,23 @@ clean_example() { # Remove previous log file rm -f "$ROOT_DIR/compile_errors.log" -compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ "esp32:esp32:esp32doit-devkit-v1" +# compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ "esp32:esp32:esp32doit-devkit-v1" # Iterate over each example directory -# for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do -# echo "$example_dir" -# # Check if the directory contains a .ino file -# if [ -f "$example_dir"/*.ino ]; then -# for board in "${BOARDS[@]}"; do -# compile_example "$example_dir" "$board" -# done - -# # Clean the example after all board-specific compilations are complete -# clean_example "$example_dir" -# else -# echo "Skipping directory $example_dir (no .ino file found)" -# fi -# done +for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do + echo "$example_dir" + # Check if the directory contains a .ino file + if [ -f "$example_dir"/*.ino ]; then + for board in "${BOARDS[@]}"; do + compile_example "$example_dir" "$board" + done + + # Clean the example after all board-specific compilations are complete + clean_example "$example_dir" + else + echo "Skipping directory $example_dir (no .ino file found)" + fi +done # Generate summary echo "Compilation Summary:" From 7a6e5978198a93ba6db743b7c96db2f389cf86e9 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Tue, 16 Jul 2024 21:56:17 +0100 Subject: [PATCH 38/48] chore: Exclude SSL_CLIENT_TEST_ENVIRONMENT from log_ header file --- src/log_.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/log_.h b/src/log_.h index 2834bd2..d6c1abe 100644 --- a/src/log_.h +++ b/src/log_.h @@ -8,6 +8,8 @@ #ifndef LOG__H_ #define LOG__H_ +#ifndef SSL_CLIENT_TEST_ENVIRONMENT + #include <Arduino.h> #ifndef LOG_LEVEL_NONE @@ -58,4 +60,6 @@ #define log_v(...) if (LOG_LEVEL >= LOG_LEVEL_VERBOSE) { Serial.printf("V ("); Serial.printf(__VA_ARGS__); Serial.println(")"); } #endif +#endif // SSL_CLIENT_TEST_ENVIRONMENT + #endif // LOG__H_ \ No newline at end of file From 2086598575509ee47dea8fa1f2429aa5e7306ec2 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 14:37:34 +0100 Subject: [PATCH 39/48] fix: arduino ide examples for v2.0.17 of arduino-esp32 --- .github/workflows/arduino_examples.yml | 4 +- .../scripts/compile_arduino_examples.sh | 2 +- .../https_eth_LilyGo-T-ETH-POE.ino | 5 - .../https_get_sim7600/certs.h | 0 .../https_get_sim7600/https_get_sim7600.ino | 3 +- .../https_get_sim7600/utilities.h | 0 .../https_post_sim7600/certs.h | 0 .../https_post_sim7600/https_post_sim7600.ino | 3 +- .../https_post_sim7600/utilities.h | 0 .../ca_cert.h | 114 +++++++++++++----- ...qtt_gsm_SIM800L_Azure_x509_Device_Twin.ino | 5 +- 11 files changed, 93 insertions(+), 43 deletions(-) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_get_sim7600/certs.h (100%) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_get_sim7600/https_get_sim7600.ino (98%) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_get_sim7600/utilities.h (100%) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_post_sim7600/certs.h (100%) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_post_sim7600/https_post_sim7600.ino (98%) rename examples/Esp32-Arduino-IDE/{https_gsm_SIM7600 => }/https_post_sim7600/utilities.h (100%) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 5dfde65..9a9099e 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -23,7 +23,6 @@ jobs: arduino-cli config init arduino-cli core update-index arduino-cli core install arduino:avr - arduino-cli core install esp32:esp32@2.0.17 - name: Install libs run: | @@ -33,6 +32,7 @@ jobs: arduino-cli lib install "PubSubClient" arduino-cli lib install "TinyGSM" - - name: Compile Examples + - name: Compile Examples for Arduino-ESP32@2.0.17 run: | + arduino-cli core install esp32:esp32@2.0.17 ./.github/workflows/scripts/compile_arduino_examples.sh --clean diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 5358ca0..0891aa4 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -70,7 +70,7 @@ clean_example() { # Remove previous log file rm -f "$ROOT_DIR/compile_errors.log" -# compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_gsm_SIM800/ "esp32:esp32:esp32doit-devkit-v1" +# compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_post_sim7600/ "esp32:esp32:esp32wroverkit" # Iterate over each example directory for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do diff --git a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino index a784312..225d292 100644 --- a/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino +++ b/examples/Esp32-Arduino-IDE/https_eth_LilyGo-T-ETH-POE/https_eth_LilyGo-T-ETH-POE.ino @@ -9,12 +9,7 @@ * Base example: https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE/blob/master/example/eth/eth.ino * **************************************************************/ -#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3,0,0) -#include <ETHClass2.h> //Is to use the modified ETHClass -#define ETH ETH2 -#else #include <ETH.h> -#endif #include "WiFi.h" #include "SSLClient.h" //To make http request esay: https://github.com/arduino-libraries/ArduinoHttpClient diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h b/examples/Esp32-Arduino-IDE/https_get_sim7600/certs.h similarity index 100% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/certs.h rename to examples/Esp32-Arduino-IDE/https_get_sim7600/certs.h diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/https_get_sim7600.ino b/examples/Esp32-Arduino-IDE/https_get_sim7600/https_get_sim7600.ino similarity index 98% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/https_get_sim7600.ino rename to examples/Esp32-Arduino-IDE/https_get_sim7600/https_get_sim7600.ino index b34bb18..40b7af3 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/https_get_sim7600.ino +++ b/examples/Esp32-Arduino-IDE/https_get_sim7600/https_get_sim7600.ino @@ -45,7 +45,7 @@ const char server[] = "vsh.pp.ua"; const char resource[] = "/TinyGSM/logo.txt"; const int port = 443; -#include <TinyGsmClient.h> +#include <TinyGSM.h> #include <ArduinoHttpClient.h> #include "SSLClient.h" #include "utilities.h" @@ -212,7 +212,6 @@ void loop() 24 - HYBRID(CDMA and eHRPD) */ modem.sendAT(GF("+CNSMOD?")); - if (modem.waitResponse(GF(GSM_NL "+CNSMOD:")) != 1) { } int nmodec = modem.stream.readStringUntil(',').toInt() != 0; int nmode = modem.stream.readStringUntil('\n').toInt(); modem.waitResponse(); diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/utilities.h b/examples/Esp32-Arduino-IDE/https_get_sim7600/utilities.h similarity index 100% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_get_sim7600/utilities.h rename to examples/Esp32-Arduino-IDE/https_get_sim7600/utilities.h diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h b/examples/Esp32-Arduino-IDE/https_post_sim7600/certs.h similarity index 100% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/certs.h rename to examples/Esp32-Arduino-IDE/https_post_sim7600/certs.h diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/https_post_sim7600.ino b/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino similarity index 98% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/https_post_sim7600.ino rename to examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino index 5811a2f..3029335 100644 --- a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/https_post_sim7600.ino +++ b/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino @@ -45,7 +45,7 @@ const char server[] = "hookb.in"; const char resource[] = "/eKKEKgbNZPCeYYRdZXDo"; const int port = 443; -#include <TinyGsmClient.h> +#include <TinyGSM.h> #include <ArduinoHttpClient.h> #include "SSLClient.h" #include "utilities.h" @@ -212,7 +212,6 @@ void loop() 24 - HYBRID(CDMA and eHRPD) */ modem.sendAT(GF("+CNSMOD?")); - if (modem.waitResponse(GF(GSM_NL "+CNSMOD:")) != 1) { } int nmodec = modem.stream.readStringUntil(',').toInt() != 0; int nmode = modem.stream.readStringUntil('\n').toInt(); modem.waitResponse(); diff --git a/examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/utilities.h b/examples/Esp32-Arduino-IDE/https_post_sim7600/utilities.h similarity index 100% rename from examples/Esp32-Arduino-IDE/https_gsm_SIM7600/https_post_sim7600/utilities.h rename to examples/Esp32-Arduino-IDE/https_post_sim7600/utilities.h diff --git a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h index 14395d3..93ce2a8 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h +++ b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/ca_cert.h @@ -1,31 +1,87 @@ -//CA Certificate for www.howsmyssl.com (valid until 12-03-2027) +// This file contains the root CA certificate, client certificate and client private key const char root_ca[] PROGMEM = -"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vbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" +"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" +"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" +"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" +"IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" +"VOujw5H5SNz/0egwLX0tdHA234gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" +"93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" +"jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" +"AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" +"A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" +"U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" +"N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" +"o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" +"5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" +"rqXRfboQnoZsG4q5WTP468SQvvG5\n" "-----END CERTIFICATE-----"; + +// certificate +const char client_cert_pem[] PROGMEM = + "-----BEGIN CERTIFICATE-----\n" +"MIIDWTCCAkGgAwIBAgIUE9evNgJkNMn0MsfViCBjxUNRMZ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Y3cQ4p35QbYuXqwXyO9EUgtKnZMHmTEAApTqXKbiqxK69gzag\n" +"rfmHT4kSSEF8ytVv4+qxGkZjrRzLRi/Oszy+TtQl1uKMp7dtREyhMXXELVc6\n" +"-----END CERTIFICATE-----"; + +// private key +const char client_private_key_pem[] PROGMEM = + "-----BEGIN RSA PRIVATE KEY-----\n" +"MIIEowIBAAKCAQEAwmU8xF0pEs7oXEM5BUwVMNG9R6X9Rl8Hk99ys2YgLznjirqQ\n" +"WV6S94kvQO8RpjGSZqwlO0yBVNh7x6ISe4/znsSh67yyjUGqiX5uZa0ubb0rnMML\n" +"rw5sROm/XAdfRdyiHQjExu0H/9LGdG9V2vOd7JfUf2lpio7K/4Uh2M0vai1bpsQX\n" +"W4uj7bClX2rYzGadqOxdD0Z4jRmsfM969WCPr2T0Xw7lM4/JYqLz89wB7stURhwI\n" +"enxvOeUKyULzNLvBf7r223j3HpxCSyDFN5BDSmbsRvB7JiJwjth5Cz/uwDSKoFfG\n" +"AWlbwVaB8rJHowU3L1AqDDK/D+5YFSDrk9DT9wIDAQABAoIBAF+o5eBTX7TrsJhG\n" +"VDbxG7RsYdJyMlKAzP/Ng2oYpVnYCMrpx8LSsUuybFhtzKeV2U9BAwlNOo+AAFla\n" +"vfGkAuRsKqoQr2Snnb4PQ1Axiplh76YyrPs2A71dsVceIZoFWpkjCYJCfh87n4EI\n" +"kJ0wKNSWWnFgdBlE70wSPXescNq0H6kj1x7ik2LfvfByyzE0VGKJlHgBSzmdac/I\n" +"a8sWSXGMyI7futhcrpKy8DHapR7a6bQYAXV2gZOXzA3t8WUctmwsNNMCCZOIJCHh\n" +"eN8XoL2ZrMNGchslu0LhyhtA7wDlCosXLYbbCIzuMh02eUK9KS+6M2mQEpuocYDx\n" +"L+WzlUECgYEA5tDxGIpTyjA1k2Pb5twljIxYzTLZZnIyhO5N2iuBeEng7PWx14Ic\n" +"UNFh4qLB/rxouhVXk5OCoNpZgEBoNJwuioaRcdrgaBp7jgGwONwrp87mDigSfgAt\n" +"sD1TinRxBlX1cupcGw4Ou/U1oLzpDSFyqtkLFkdbj57ZtYIvIV/QfDECgYEA15sB\n" +"+GXJs2+Rgy1CncOdX3wB1BVX4eX/yF7oihsPfjXq87ZT8WK1wveUI7X0eVV4hcgp\n" +"t5Xlwy4MfRLtg+jyWS3RWgWK04Y7ypOZdGVLrvPXBg6VrcF6dJXPMSIEL4JMVm+P\n" +"OuHCTItI+WDGBJDbj/ctefrzMG2cfgxbwVpo0KcCgYEAl5j8AQY5aj6nsZqQv9wv\n" +"vVQgrwWKzEKM88ogz/5rFrpPRNNKbyVBu8MJ63TCvbC5iB6kWoUz8rn2tsmWp5c8\n" +"6jbgKEt9wGJEbEynlXDmK100tG+VVbSATZS53eIEqgijIUrUG+DrxH+VLXFmD/27\n" +"9oJ/Sa6scHQAwbozglQP9sECgYAz5nxy7w2+w/yjNyHyGESp15AZHYoqNtN7yFzx\n" +"4dG48AG+6QUL9lcKt85RSluvWYPJsIVaTBsjANLAyO2j809jaEQdB3iDsqxx91XZ\n" +"TwkI9Gmua5RcX1a6+dUGXsnjJdp6dCBmbDH5ew31+fWw46322el4k5A2+CvTq+Xq\n" +"hXj1wQKBgHDlcPYRv+GVZZGY6ZV9eK4zs9p2EijbJveS1GH6a6eEnIrfeSeXiUou\n" +"w3h/ecyBCQDwC3ju6qSiNBfXzW+rYIHbE7ztR/10hEWv/FG0eJ4Ul8/I588gfJnn\n" +"1my9XCbBOJfyxpaykYeGz+Kbu6ge93FSLtDbFwZvSwJMy7xbzZ2d\n" +"-----END RSA PRIVATE KEY-----"; + +// certificate +const char client_public_key_pem[] PROGMEM = + "-----BEGIN PUBLIC KEY-----\n" +"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwmU8xF0pEs7oXEM5BUwV\n" +"MNG9R6X9Rl8Hk99ys2YgLznjirqQWV6S94kvQO8RpjGSZqwlO0yBVNh7x6I234/z\n" +"nsSh67yyjUGqiX5uZa0ubb0rnMMLrw5sROm/XAdfRdyiHQjExu0H/9LGdG9V2vOd\n" +"7JfUf2lpio7K/4Uh2M0vai1bpsQXW4uj7bClX2rYzGadqOxdD0Z4jRmsfM969WCP\n" +"r2T0Xw7lM4/JYqLz89wB7stURhwIenxvOeUKyULzNLvBf7r2rAj3HpxCSyDFN5BD\n" +"SmbsRvB7JiJwjth5Cz/uwDSKoFfGAWlbwVaB8rJHowU3L1AqDDK/D+5YFSDrk9DT\n" +"9wIDAQAB\n" +"-----END PUBLIC KEY-----"; \ No newline at end of file diff --git a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino index 556b773..da04ef4 100644 --- a/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino +++ b/examples/Esp32-Arduino-IDE/mqtt_gsm_SIM800L_Azure_x509_Device_Twin/mqtt_gsm_SIM800L_Azure_x509_Device_Twin.ino @@ -187,9 +187,10 @@ void setup() //Add CA Certificate + // Update with you own certs! These are for AWS IoT and here for example only. secure_presentation_layer.setCACert(root_ca); - secure_presentation_layer.setCertificate(client_cert_pem_start); //x509 client Certificate - secure_presentation_layer.setPrivateKey(client_key_pem_start); //x509 client key + secure_presentation_layer.setCertificate(client_cert_pem); //x509 client Certificate + secure_presentation_layer.setPrivateKey(client_public_key_pem); //x509 client key // Modem initial setup setupModem(); From f1f6ade6b790eddfa4627dc006b7144310165906 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 14:40:50 +0100 Subject: [PATCH 40/48] fix: add pyserial --- .github/workflows/arduino_examples.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 9a9099e..0a638c7 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -15,6 +15,9 @@ jobs: with: python-version: '3.8' + - name: Install pyserial + run: python3 -m pip install pyserial + - name: Install Arduino CLI uses: arduino/setup-arduino-cli@v2 From 8559c5f6cc2d3c33dfa3a2897a76bf6bd1109e6d Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 22:04:38 +0100 Subject: [PATCH 41/48] chore: Update Arduino CLI utility script to include ESP32-Arduino@3.0.3 version switching functionality --- .github/workflows/arduino_examples.yml | 10 ++++++++++ .../scripts/compile_arduino_examples.sh | 14 ++++---------- .../scripts/install_sslclient_for_testing.sh | 19 +++---------------- .../https_post_sim7600/https_post_sim7600.ino | 1 - 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 0a638c7..b13d959 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -39,3 +39,13 @@ jobs: run: | arduino-cli core install esp32:esp32@2.0.17 ./.github/workflows/scripts/compile_arduino_examples.sh --clean + + - name: Compile Examples for Arduino-ESP32@3.0.2 + run: | + arduino-cli core install esp32:esp32@3.0.2 + ./.github/workflows/scripts/compile_arduino_examples.sh --clean + + - name: Compile Examples for Arduino-ESP32@3.0.3 + run: | + arduino-cli core install esp32:esp32@3.0.3 + ./.github/workflows/scripts/compile_arduino_examples.sh --clean diff --git a/.github/workflows/scripts/compile_arduino_examples.sh b/.github/workflows/scripts/compile_arduino_examples.sh index 0891aa4..17909e7 100755 --- a/.github/workflows/scripts/compile_arduino_examples.sh +++ b/.github/workflows/scripts/compile_arduino_examples.sh @@ -1,10 +1,7 @@ #!/usr/bin/bash -# Set the root directory containing the example directories ROOT_DIR=$(pwd) CLEAN=false - -# Boards to test BOARDS=("esp32:esp32:esp32doit-devkit-v1" "esp32:esp32:esp32wroverkit") # Parse command line options @@ -18,6 +15,7 @@ done # Initialize results array declare -A RESULTS +EXIT_STATUS=0 # Function to compile the example for a specific board compile_example() { @@ -27,13 +25,12 @@ compile_example() { example_name=$(basename "$example_dir") echo "Compiling example in directory: $example_dir for board: $board" - # Change to the example directory cd "$example_dir" || exit 1 - # Compile the example using arduino-cli arduino-cli compile --clean --fqbn "$board" . || { echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log" RESULTS["$example_name,$board"]="Failed" + EXIT_STATUS=1 return 1 } @@ -46,10 +43,8 @@ clean_example() { local example_dir=$1 echo "Cleaning example in directory: $example_dir" - # Change to the example directory cd "$example_dir" || exit 1 - # Clean the example using arduino-cli arduino-cli cache clean || { echo "Cleaning failed for $example_dir" return 1 @@ -63,11 +58,9 @@ clean_example() { rm -rf build fi - # Return to the root directory cd "$ROOT_DIR" || exit 1 } -# Remove previous log file rm -f "$ROOT_DIR/compile_errors.log" # compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_post_sim7600/ "esp32:esp32:esp32wroverkit" @@ -81,7 +74,6 @@ for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do compile_example "$example_dir" "$board" done - # Clean the example after all board-specific compilations are complete clean_example "$example_dir" else echo "Skipping directory $example_dir (no .ino file found)" @@ -97,3 +89,5 @@ for key in "${!RESULTS[@]}"; do done echo "All examples processed. Check compile_errors.log for any compilation errors." + +exit $EXIT_STATUS diff --git a/.github/workflows/scripts/install_sslclient_for_testing.sh b/.github/workflows/scripts/install_sslclient_for_testing.sh index e8b924c..ee7443f 100755 --- a/.github/workflows/scripts/install_sslclient_for_testing.sh +++ b/.github/workflows/scripts/install_sslclient_for_testing.sh @@ -1,25 +1,12 @@ #!/usr/bin/bash -# Remove existing SSLClient directory to avoid conflicts rm -rf ~/SSLClient - -# Clone the repository git clone https://github.com/govorox/SSLClient.git ~/SSLClient cd ~/SSLClient - -# Checkout the desired branch -git checkout v1.3.0 # Use the correct branch name if different - -# Ensure correct structure -mkdir -p SSLClient # Create the directory for the library files -mv LICENCE library.properties src SSLClient/ - -# Compress the directory +git checkout v1.3.0 +mkdir -p SSLClient +mv LICENSE library.properties src SSLClient/ zip -r SSLClient.zip SSLClient - -# Enable unsafe installs in Arduino CLI configuration mkdir -p ~/.arduino15 echo -e "library:\n enable_unsafe_install: true" > ~/.arduino15/arduino-cli.yaml - -# Install the library using Arduino CLI arduino-cli lib install --config-file ~/.arduino15/arduino-cli.yaml --zip-path SSLClient.zip diff --git a/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino b/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino index 3029335..df40d6d 100644 --- a/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino +++ b/examples/Esp32-Arduino-IDE/https_post_sim7600/https_post_sim7600.ino @@ -8,7 +8,6 @@ * Just comment them out. * https://simcom.ee/documents/SIM7600C/SIM7500_SIM7600%20Series_AT%20Command%20Manual_V1.01.pdf **************************************************************/ - #define TINY_GSM_MODEM_SIM7600 // Set serial for debug console (to the Serial Monitor, default speed 115200) From 94397f4fa12a3e91ac8be5f572f64d4f811cdc7a Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 22:14:05 +0100 Subject: [PATCH 42/48] chore: Install specific branch of GovoroxSSLClient library for Arduino examples --- .github/workflows/arduino_examples.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index b13d959..08f538f 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -27,9 +27,13 @@ jobs: arduino-cli core update-index arduino-cli core install arduino:avr - - name: Install libs + - name: Install specific branch of GovoroxSSLClient + run: | + mkdir -p ~/Arduino/libraries + git clone --branch v1.3.0 https://github.com/govorox/SSLClient.git ~/Arduino/libraries/GovoroxSSLClient + + - name: Install other libs run: | - arduino-cli lib install "GovoroxSSLClient" arduino-cli lib install "WiFi" arduino-cli lib install "ArduinoHttpClient" arduino-cli lib install "PubSubClient" @@ -45,7 +49,7 @@ jobs: arduino-cli core install esp32:esp32@3.0.2 ./.github/workflows/scripts/compile_arduino_examples.sh --clean - - name: Compile Examples for Arduino-ESP32@3.0.3 - run: | - arduino-cli core install esp32:esp32@3.0.3 - ./.github/workflows/scripts/compile_arduino_examples.sh --clean + # - name: Compile Examples for Arduino-ESP32@3.0.3 + # run: | + # arduino-cli core install esp32:esp32@3.0.3 + # ./.github/workflows/scripts/compile_arduino_examples.sh --clean From 9666d0c8025f61ceeb34ec4d6186ee185bcdd076 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 22:21:18 +0100 Subject: [PATCH 43/48] chore: Update Arduino CLI utility script to include ESP32-Arduino@3.0.3 version switching functionality --- .github/workflows/arduino_examples.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 08f538f..91b27a7 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -39,17 +39,17 @@ jobs: arduino-cli lib install "PubSubClient" arduino-cli lib install "TinyGSM" - - name: Compile Examples for Arduino-ESP32@2.0.17 - run: | - arduino-cli core install esp32:esp32@2.0.17 - ./.github/workflows/scripts/compile_arduino_examples.sh --clean - - - name: Compile Examples for Arduino-ESP32@3.0.2 - run: | - arduino-cli core install esp32:esp32@3.0.2 - ./.github/workflows/scripts/compile_arduino_examples.sh --clean + # - name: Compile Examples for Arduino-ESP32@2.0.17 + # run: | + # arduino-cli core install esp32:esp32@2.0.17 + # ./.github/workflows/scripts/compile_arduino_examples.sh --clean - # - name: Compile Examples for Arduino-ESP32@3.0.3 + # - name: Compile Examples for Arduino-ESP32@3.0.2 # run: | - # arduino-cli core install esp32:esp32@3.0.3 + # arduino-cli core install esp32:esp32@3.0.2 # ./.github/workflows/scripts/compile_arduino_examples.sh --clean + + - name: Compile Examples for Arduino-ESP32@3.0.3 + run: | + arduino-cli core install esp32:esp32@3.0.3 + ./.github/workflows/scripts/compile_arduino_examples.sh --clean From 8bdbaaa321302b5401f019059ff4a6cb8aed8b85 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Wed, 17 Jul 2024 22:25:12 +0100 Subject: [PATCH 44/48] chore: Update Arduino CLI utility script to include ESP32-Arduino@3.0.2 version switching functionality --- .github/workflows/arduino_examples.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 91b27a7..7336146 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -44,12 +44,7 @@ jobs: # arduino-cli core install esp32:esp32@2.0.17 # ./.github/workflows/scripts/compile_arduino_examples.sh --clean - # - name: Compile Examples for Arduino-ESP32@3.0.2 - # run: | - # arduino-cli core install esp32:esp32@3.0.2 - # ./.github/workflows/scripts/compile_arduino_examples.sh --clean - - - name: Compile Examples for Arduino-ESP32@3.0.3 + - name: Compile Examples for Arduino-ESP32@3.0.2 run: | - arduino-cli core install esp32:esp32@3.0.3 + arduino-cli core install esp32:esp32@3.0.2 ./.github/workflows/scripts/compile_arduino_examples.sh --clean From d019c803c16053fe5756e17ae46d615a70670622 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Thu, 18 Jul 2024 20:29:08 +0100 Subject: [PATCH 45/48] docs: update READMEs --- README.md | 75 +++++++++++++++++++++----------------------- docs/CONTRIBUTING.md | 4 +++ docs/RSSI.md | 17 ++++++++++ 3 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 docs/RSSI.md diff --git a/README.md b/README.md index b75742b..70761bd 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,46 @@ [](#license) [](https://github.com/govorox/SSLClient/issues) +## Table of Contents + +1. [Installation](#-installation) - How to install the library using Arduino or PlatformIO. +2. [Overview of this Library](#-overview) - An overview of the SSLClient library. +3. [What's New](#-whats-new-in-the-latest-release) - The latest features and updates. +4. [Features](#-features) - Key features of the SSLClient library. +5. [Usage](#-usage) - Basic usage examples for the SSLClient library. +6. [Overview of Functions](docs/FUNCTIONS.md) - An overview of the API for leveraging MbedTLS. +7. [Contribute](docs/CONTRIBUTING.md) - Contributions are welcome! +8. [Change Log](docs/CHANGELOG.md) - See what's new in each release. +9. [Code Guide](docs/CODEGUIDE.md) - Guidelines for contributing to the project. +10. [Signal Strength Map](docs/RSSI.md) - Useful for debugging GSM connectivity. +11. [License](#-license) - The license for the SSLClient library (open-source). + +## 🔧 Installation + +Install via the Arduino Library Manager or PlatformIO plugin: + +[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") + +**Arduino IDE** - search for "SSLClient" + +[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") + +**VSCode / PlatformIO** - add `digitaldragon/SSLClient@^1.3.0` to `platformio.ini` + ## 🚀 Overview -SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, providing a transparent SSL/TLS layer over any **Client** class instance. Leverages *mbedtls* for robust, efficient cryptographic operations, initially tailored for ESP32 but adaptable across platforms. +Originally based on the `WiFiClientSecure` for Arduino-ESP32 the SSLClient extends the ESP32/Arduino ecosystem to secure communication via TLS, providing a transparent SSL/TLS layer over any `Client` class instance. Leverages *mbedtls* for robust, efficient cryptographic operations, initially tailored for ESP32 but adaptable across platforms. + +## 🌟 What's New in the Latest Release -Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFiClientSecure) for Arduino/ESP32. +**Major Versions 2 and 3 of MBedTLS**: Updated to support the latest version of the MBedTLS library. -## 🌟 What's New -**Major Versions 2 and 3 of MBedTLS**: Updated to support the latest versions of the MBedTLS library. **ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. + **Cert Bundles**: Simplifies management and use of multiple CA certificates. + **Bug Fix**: Corrects byte calculation for record expansion post-handshake. + **More Examples**: Examples for the ESP32 PlatformIO for ALPN protocols, AWS, and using certificate bundles. ## ✨ Features @@ -35,21 +64,9 @@ Based on the [WiFiClientSecure](https://github.com/espressif/arduino-esp32/tree/ **Specifics:** `TLS 1.2`: Continues full support with extensive cipher suites and features. `TLS 1.3`: Introduced in Mbed `TLS 3.x`, providing enhanced security features, improved performance, and simplified handshake process. -- Compatible with Arduino/ESP32 and potentially other platforms. +- Compatible with Arduino-ESP32 and potentially other platforms. - Suitable for IoT applications, including AWS IoT. -## 🔧 Installation - -Install via the Arduino Library Manager or PlatformIO plugin: - -[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") - -**Arduino IDE** - search for "SSLClient" - -[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") - -**VSCode / PlatformIO** - add `digitaldragon/SSLClient@^1.3.0` to `platformio.ini` - ## 🛠Usage ### Basic Connection @@ -58,6 +75,7 @@ Install via the Arduino Library Manager or PlatformIO plugin: #include <SSLClient.h> // Initialize your transport layer (e.g., WiFi, GSM) +// A Client is anything which inherits from the Arduino Client class. Client transport = /* Your transport layer */; // Create SSLClient instance @@ -82,27 +100,6 @@ MQTTClient mqtt = MQTTClient(256); mqtt.begin(AWS_IOT_ENDPOINT, 8883, secure); ``` -### For details on the functions, see [📚 Function Notes](docs/FUNCTIONS.md) - -## 🖥 Contributions Welcome - -Contributions are welcome! Please fork the repository and submit pull requests with your enhancements. For more information on contributing, please refer to the [Contributing Guide](docs/CONTRIBUTING.md). - -## For more details, see the [Change Log](docs/CHANGELOG.md). - - ## 📄 License -The library is released under GNU General Public Licence. See the LICENSE file for more details. - -## 📶 Handy CSQ / RSSI / Signal Strength Mapping - -| CSQ Value | RSSI (dBm) | Description | -|-----------|---------------------|------------------| -| 0 | -113 dBm or less | No signal | -| 1-2 | -111 dBm to -109 dBm| Very poor signal | -| 3-9 | -107 dBm to -93 dBm | Poor signal | -| 10-14 | -91 dBm to -83 dBm | Fair signal | -| 15-19 | -81 dBm to -73 dBm | Good signal | -| 20-30 | -71 dBm to -53 dBm | Very good signal | -| 31 | -51 dBm or more | Excellent signal | +The library is released under GNU General Public Licence. See the `LICENSE` file for more details. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3540733..d8a0515 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,15 +1,18 @@ [](../README.md) # Contributing to SSLClient + Thank you for considering contributing to SSLClient! Please follow these guidelines to help us review your contributions more efficiently. ## How to Report an Issue + 1. Search for similar issues in the [issue tracker](https://github.com/govorox/SSLClient/issues) to avoid duplicates. 2. Use the provided [issue templates](https://github.com/govorox/SSLClient/tree/master/.github/ISSUE_TEMPLATE) to ensure all necessary information is included. 3. Provide a clear and descriptive title for the issue. 4. Include steps to reproduce the issue, expected and actual behavior, and details about your environment. ## How to Submit a Pull Request + 1. Fork the repository and create your branch from `main`. 2. Ensure your code follows the project's coding standards. 3. Update documentation as necessary. @@ -17,6 +20,7 @@ Thank you for considering contributing to SSLClient! Please follow these guideli 5. Ensure all tests pass before submitting the pull request. ## Coding Standards + - Follow the [existing code style](CODEGUIDE.md). - Write clear and concise commit messages. - Include comments where necessary for clarity. diff --git a/docs/RSSI.md b/docs/RSSI.md new file mode 100644 index 0000000..a69945b --- /dev/null +++ b/docs/RSSI.md @@ -0,0 +1,17 @@ +[](../README.md) + +# Signal Strength Map + +This is particularly useful for debugging connectivity issues with GSM and other cellular modems. + +## 📶 CSQ / RSSI / Signal Strength Map + +| CSQ Value | RSSI (dBm) | Description | +|-----------|---------------------|------------------| +| 0 | -113 dBm or less | No signal | +| 1-2 | -111 dBm to -109 dBm| Very poor signal | +| 3-9 | -107 dBm to -93 dBm | Poor signal | +| 10-14 | -91 dBm to -83 dBm | Fair signal | +| 15-19 | -81 dBm to -73 dBm | Good signal | +| 20-30 | -71 dBm to -53 dBm | Very good signal | +| 31 | -51 dBm or more | Excellent signal | From 49437bd3fce3cb5aa7ee755cba8b26f26cbcd4f2 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Thu, 18 Jul 2024 20:32:40 +0100 Subject: [PATCH 46/48] chore: Update info --- .github/workflows/arduino_examples.yml | 14 +++++++------- library.json | 2 +- library.properties | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 7336146..465bf00 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -39,12 +39,12 @@ jobs: arduino-cli lib install "PubSubClient" arduino-cli lib install "TinyGSM" - # - name: Compile Examples for Arduino-ESP32@2.0.17 - # run: | - # arduino-cli core install esp32:esp32@2.0.17 - # ./.github/workflows/scripts/compile_arduino_examples.sh --clean - - - name: Compile Examples for Arduino-ESP32@3.0.2 + - name: Compile Examples for Arduino-ESP32@2.0.17 run: | - arduino-cli core install esp32:esp32@3.0.2 + arduino-cli core install esp32:esp32@2.0.17 ./.github/workflows/scripts/compile_arduino_examples.sh --clean + + # - name: Compile Examples for Arduino-ESP32@3.0.2 + # run: | + # arduino-cli core install esp32:esp32@3.0.2 + # ./.github/workflows/scripts/compile_arduino_examples.sh --clean diff --git a/library.json b/library.json index 7634273..26d7ca1 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SSLClient", - "version": "1.3.0-rc1", + "version": "1.3.0", "repository": { "type": "git", diff --git a/library.properties b/library.properties index 530b6da..e8690b7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GovoroxSSLClient -version=1.3.0-rc1 +version=1.3.0 author=V Govorovski maintainer=Robert Byrnes <robbyrnes@hotmail.co.uk> sentence=Provides secure network connection over a generic Client transport object. From ae210ab2517051aa93b39d2acf777cd469f87f20 Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Thu, 18 Jul 2024 21:04:59 +0100 Subject: [PATCH 47/48] chore: Update Unit Tests workflow name --- .github/workflows/ci_master.yml | 2 +- README.md | 37 +++++++++++++++++++++++---------- docs/CHANGELOG.md | 24 ++++++++++++++++++++- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index 207cecc..d429a34 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -1,4 +1,4 @@ -name: Run PlatformIO Tests +name: Run Unit Tests on: push: diff --git a/README.md b/README.md index 70761bd..7b67f70 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,20 @@ ## 🔧 Installation -Install via the Arduino Library Manager or PlatformIO plugin: +<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;"> + <a href="https://www.arduinolibraries.info/libraries/govorox-ssl-client" title="Go to Arduino Libraries"> + <img src="https://img.shields.io/static/v1?label=Arduino%20Libraries&message=GovoroxSSLClient&color=orange&logo=arduino" alt="arduino-library-badge"> + </a> + <a href="https://registry.platformio.org/libraries/digitaldragon/SSLClient" title="Go to PlatformIO Registry"> + <img src="https://badges.registry.platformio.org/packages/digitaldragon/library/SSLClient.svg" alt="PlatformIO Registry"> + </a> +</div> -[](https://www.arduinolibraries.info/libraries/govorox-ssl-client "Go to Arduino Libraries") +*Install via the Arduino IDE or PlatformIO:* -**Arduino IDE** - search for "SSLClient" +**Arduino IDE** - search for `GovoroxSSLClient` inthe library manager (for now, ensure esp32 boards are installed to version `2.0.17` and no higher) -[](https://registry.platformio.org/libraries/digitaldragon/SSLClient "Go to PlatformIO Registry") - -**VSCode / PlatformIO** - add `digitaldragon/SSLClient@^1.3.0` to `platformio.ini` +**PlatformIO** - add `digitaldragon/SSLClient@^1.3.0` to `platformio.ini` ## 🚀 Overview @@ -40,15 +45,25 @@ Originally based on the `WiFiClientSecure` for Arduino-ESP32 the SSLClient exten ## 🌟 What's New in the Latest Release -**Major Versions 2 and 3 of MBedTLS**: Updated to support the latest version of the MBedTLS library. +- **Major Versions 2 and 3 of MBedTLS**: Updated to support the latest version of the MBedTLS library. + +- **Feature flag for compatibility with MbedTLS v3.x.x** - Automated by `MBEDTLS_VERSION_MAJOR`. + +- **Add Flag `MBEDTLS_BACKPORT`** to allow override `MBEDTLS_VERSION_MAJOR >= 3`. + +- **Add workaround for W5500 Ethernet failing** due to client returning -1 when no error - switch on flag `W5500_WORKAROUND`. + +- **Close the following issues:** Support for ESP32 and W5500 based Secure Ethernet for HTTPS or MQTTS? [#44](https://github.com/govorox/SSLClient/issues/85) and issue SSLClient with W5500 not working (works well with WiFi and TinyGSM) [#85](https://github.com/govorox/SSLClient/issues/85). + +- **Improve documentation** -**ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. +- **Add GitHub Actions workflow** to ensure PlatformIO examples compile. -**Cert Bundles**: Simplifies management and use of multiple CA certificates. +- **Update GitHub Actions workflow** to run tests multiple times with feature flags set. -**Bug Fix**: Corrects byte calculation for record expansion post-handshake. +- **Add GitHub Actions workflow** to ensure Arduino IDE compile. -**More Examples**: Examples for the ESP32 PlatformIO for ALPN protocols, AWS, and using certificate bundles. +- **Fix Arduino IDE examples to compile** when using `arduino-esp32@2.0.17` - This is still broken for `@3.0.2`. There is a breaking change in `arduino-esp32` from `v3.0.0` which is causing ambiguous reference errors to byte. ## ✨ Features diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c52ffac..6225c02 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -20,4 +20,26 @@ 9. Separate concerns from start_ssl_client into singly responsible functions and unit test private API, commit: 0f1fa36 -10. Close issue [#60](https://github.com/govorox/SSLClient/issues/60), Naming collision changes to make compatibile compilation with WiFiClientSecure, commit: b8a9e7e \ No newline at end of file +10. Close issue [#60](https://github.com/govorox/SSLClient/issues/60), Naming collision changes to make compatibile compilation with WiFiClientSecure, commit: b8a9e7e + +11. `v1.2.0` + + **ALPN Support**: Application Layer Protocol Negotiation for efficient server communication. + + **Cert Bundles**: Simplifies management and use of multiple CA certificates. + + **Bug Fix**: Corrects byte calculation for record expansion post-handshake. + + **More Examples**: Examples for the ESP32 PlatformIO for ALPN protocols, AWS, and using certificate bundles. + +12. `v1.3.0` + + - Feature flag for compatibility with MbedTLS v3.x.x - Automated by MBEDTLS_VERSION_MAJOR. + - Add Flag MBEDTLS_BACKPORT to allow override MBEDTLS_VERSION_MAJOR >= 3. + - Add workaround for W5500 Ethernet failing due to client returning -1 when no error - switch on flag W5500_WORKAROUND. + - closes issue Support for ESP32 and W5500 based Secure Ethernet for HTTPS or MQTTS? [#44](https://github.com/govorox/SSLClient/issues/85) and closes issue SSLClient with W5500 not working (works well with WiFi and TinyGSM) [#85](https://github.com/govorox/SSLClient/issues/85). + - Improve documentation. + - Add GitHub Actions workflow to ensure PlatformIO examples compile. + - Update GitHub Actions workflow to run tests multiple times with feature flags set. + - Add GitHub Actions workflow to ensure Arduino IDE compile. + - Fix Arduino IDE examples to compile when using arduino-esp32 @2.0.17 - This is still broken for @3.0.2 There is a breaking change in arduino-esp32 from v3.0.0 which is causing ambiguous reference errors to byte. \ No newline at end of file From f448137cdbc529e53abc252dae3e2cb0b96fcafb Mon Sep 17 00:00:00 2001 From: RobertByrnes <robbyrnes@hotmail.co.uk> Date: Thu, 18 Jul 2024 21:16:12 +0100 Subject: [PATCH 48/48] fix: remove dupe #endif --- .github/workflows/arduino_examples.yml | 2 +- .github/workflows/ci_master.yml | 1 - .github/workflows/pio_examples.yml | 2 +- src/certBundle.c | 3 --- src/ssl__client.cpp | 3 --- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 465bf00..75ca1cf 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -1,6 +1,6 @@ name: Build Arduino Examples -on: [push, pull_request] +on: [pull_request] jobs: build: diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index d429a34..ff4fff3 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -8,7 +8,6 @@ on: pull_request: branches: - master - - 'v[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: jobs: diff --git a/.github/workflows/pio_examples.yml b/.github/workflows/pio_examples.yml index c142b58..e8495cc 100644 --- a/.github/workflows/pio_examples.yml +++ b/.github/workflows/pio_examples.yml @@ -1,6 +1,6 @@ name: Build PlatformIO Examples -on: [push, pull_request] +on: [pull_request] jobs: build: diff --git a/src/certBundle.c b/src/certBundle.c index 6657fc2..b205751 100644 --- a/src/certBundle.c +++ b/src/certBundle.c @@ -57,7 +57,6 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k if (!mbedtls_pk_can_do(&parent.pk, child->private_sig_pk)) { #else if (!mbedtls_pk_can_do(&parent.pk, child->sig_pk)) { -#endif #endif log_e("Simple compare failed"); ret = -1; @@ -68,7 +67,6 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k md_info = mbedtls_md_info_from_type(child->private_sig_md); #else md_info = mbedtls_md_info_from_type(child->sig_md); -#endif #endif if ( (ret = mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash )) != 0 ) { log_e("Internal mbedTLS error %X", ret); @@ -80,7 +78,6 @@ static int esp_crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_k #else if ((ret = mbedtls_pk_verify_ext(child->sig_pk, child->sig_opts, &parent.pk, child->sig_md, hash, mbedtls_md_get_size( md_info ), child->sig.p, child->sig.len )) != 0 ) { -#endif #endif log_e("PK verify failed with error %X", ret); goto cleanup; diff --git a/src/ssl__client.cpp b/src/ssl__client.cpp index 75ec16b..bd8a674 100644 --- a/src/ssl__client.cpp +++ b/src/ssl__client.cpp @@ -579,7 +579,6 @@ int auth_client_cert_key(sslclient__context *ssl_client, const char *cli_cert, c mbedtls_ctr_drbg_free(&ctr_drbg); #else ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0); -#endif #endif if (ret != 0) { // PK or PEM non-zero error codes mbedtls_x509_crt_free(&ssl_client->client_cert); // cert+key are free'd in pair @@ -829,7 +828,6 @@ void stop_ssl_socket(sslclient__context *ssl_client, const char *rootCABuff, con if (ssl_client->ssl_conf.private_ca_chain != NULL) { #else if (ssl_client->ssl_conf.ca_chain != NULL) { -#endif #endif log_d("Freeing CA cert. Current ca_cert address: %p", (void *)&ssl_client->ca_cert); @@ -840,7 +838,6 @@ void stop_ssl_socket(sslclient__context *ssl_client, const char *rootCABuff, con if (ssl_client->ssl_conf.private_key_cert != NULL) { #else if (ssl_client->ssl_conf.key_cert != NULL) { -#endif #endif log_d("Freeing client cert and client key. Current client_cert address: %p, client_key address: %p", (void *)&ssl_client->client_cert, (void *)&ssl_client->client_key);