Skip to content

Commit

Permalink
Fix preprocessor directives.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Aug 9, 2023
1 parent 46c26ca commit 22fc8ea
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 29 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_SSLClient.svg) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/ESP_SSLClient.svg)

The upgradable SSL Client for ESP8266, ESP32, Raspberry Pi Pico (RP2040) and all Arduino devices that supports external networking interfaces e.g., WiFiClient, EthernetClient, and GSMClient.
The upgradable SSL Client for ESP8266, ESP32, Raspberry Pi Pico (RP2040) and other Arduino devices (except for avr) that supports external networking interfaces e.g., WiFiClient, EthernetClient, and GSMClient.

This library provided the Secure Layer Networking (SSL/TLS) TCP Client.

Expand All @@ -25,7 +25,6 @@ This library is fully compatible and able to work with [ESP-Mail-Client](https:/
* ESP8266
* Arduino SAMD
* Arduino STM32
* Arduino AVR
* Teensy 3.1 to 4.1
* Arduino Nano RP2040 Connect
* Raspberry Pi Pico
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ESP_SSLClient",
"version": "2.0.8",
"version": "2.0.9",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.",
"description": "This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices (except for avr) that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.",
"repository": {
"type": "git",
"url": "https://github.com/mobizt/ESP_SSLClient.git"
Expand All @@ -12,5 +12,5 @@
"email": "k_suwatchai@hotmail.com"
}],
"frameworks": "arduino",
"platforms": "espressif32, espressif8266, atmelsam, atmelavr, atmelmegaavr, ststm32, teensy, rp2040, renesas-ra"
"platforms": "espressif32, espressif8266, atmelsam, ststm32, teensy, rp2040, renesas-ra"
}
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name=ESP_SSLClient

version=2.0.8
version=2.0.9

author=Mobizt

maintainer=Mobizt <k_suwatchai@hotmail.com>

sentence=The upgradable SSL Client for Arduino devices.

paragraph=This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.
paragraph=This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices (except for avr) that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.

category=Communication

url=https://github.com/mobizt/ESP_SSLClient.git

architectures=esp8266, esp32, sam,samd, stm32, STM32F1, STM32F4, teensy, avr, megaavr, mbed_nano, mbed_rp2040, rp2040, mbed_nano, mbed_portenta, mbed_nicla, mbed_opta, mbed_giga, renesas_portenta, renesas_uno
architectures=esp8266, esp32, sam,samd, stm32, STM32F1, STM32F4, teensy, mbed_nano, mbed_rp2040, rp2040, mbed_nano, mbed_portenta, mbed_nicla, mbed_opta, mbed_giga, renesas_portenta, renesas_uno
13 changes: 8 additions & 5 deletions src/ESP_SSLClient.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
*
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.8
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.9
*
* Created August 8, 2023
* Created August 9, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -34,11 +34,14 @@
#ifndef SSLCLIENT_CONNECTION_UPGRADABLE
#define SSLCLIENT_CONNECTION_UPGRADABLE
#endif

#include "ESP_SSLClient_Const.h"
#if defined(USE_EMBED_SSL_ENGINE) || defined(USE_LIB_SSL_ENGINE)
#include "client/BSSL_TCP_Client.h"

class ESP_SSLClient : public BSSL_TCP_Client
{
#else
class ESP_SSLClient
#endif
{
public:
ESP_SSLClient(){};
~ESP_SSLClient(){};
Expand Down
14 changes: 14 additions & 0 deletions src/ESP_SSLClient_Const.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#include <Arduino.h>
#include <Client.h>

#if defined(__AVR__)
#undef USE_LIB_SSL_ENGINE
#undef USE_EMBED_SSL_ENGINE
#error "Not support AVR architecture"
#endif

#define ESP_SSLCLIENT_VALID_TIMESTAMP 1690979919

#ifndef SSLCLIENT_CONNECTION_UPGRADABLE
Expand All @@ -24,6 +30,12 @@
#define ESP_SSLCLIENT_DEBUG_PRINT(...)
#endif

#if !defined(FPSTR)
#define FPSTR
#endif

#if defined(USE_EMBED_SSL_ENGINE) || defined(USE_LIB_SSL_ENGINE)

enum esp_ssl_client_debug_level
{
esp_ssl_debug_none = 0,
Expand Down Expand Up @@ -121,4 +133,6 @@ static bool send_abort(Client *probe, bool supportsLen)

const uint16_t _secure_ports[26] = {443 /* HTTPS */, 465 /* SMTP */, 563 /* NNTP */, 636 /* LDAPS */, 695 /* IEEE-MMS-SSL */, 832 /* NETCONF */, 853 /* DNS */, 989 /* FTPS */, 990 /* FTPS */, 992 /* Telnet */, 993 /* IMAP */, 995 /* POP3 */, 4116 /* Smartcard */, 4843 /* OPC */, 5061 /* SIP */, 5085 /* LLIP */, 5349 /* NAT */, 5671 /* AMQP */, 5986 /* WinRM-HTTPS */, 6513 /* NETCONF */, 6514 /* Syslog */, 6515 /* Elipse RPC */, 6619 /* OFTP */, 8243 /* Apache Synapse */, 8403 /* GxFWD */, 8883 /* MQTT */};

#endif

#endif
4 changes: 2 additions & 2 deletions src/ESP_SSLClient_FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ESP_SSLClient_FS_H

#if (defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)) && !defined(ARDUINO_NANO_RP2040_CONNECT)
// for ESP8266 and Raspberry Pi Pico (RP2040) only except for Arduino Nano RP2040 Connect
// for ESP8266 and Raspberry Pi Pico (RP2040) only except for Arduino Nano RP2040 Connect
#define USE_EMBED_SSL_ENGINE
#else
#define USE_LIB_SSL_ENGINE
Expand Down Expand Up @@ -32,7 +32,7 @@

#if defined __has_include
#if __has_include(<Custom_ESP_SSLClient_FS.h>)
#include "Custom_ESP_SSLClient_FS"
#include "Custom_ESP_SSLClient_FS.h"
#endif
#endif

Expand Down
1 change: 1 addition & 0 deletions src/client/BSSL_CertStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE)

#include "BSSL_CertStore.h"
Expand Down
1 change: 1 addition & 0 deletions src/client/BSSL_CertStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE)


Expand Down
1 change: 1 addition & 0 deletions src/client/BSSL_Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE)

#include "BSSL_Helper.h"
Expand Down
3 changes: 3 additions & 0 deletions src/client/BSSL_Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"

#if defined(USE_EMBED_SSL_ENGINE)

Expand Down Expand Up @@ -73,6 +74,7 @@

#endif

#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)
// Cache for a TLS session with a server
// Use with BearSSL::WiFiClientSecure::setSession
// to accelerate the TLS handshake
Expand Down Expand Up @@ -441,5 +443,6 @@ namespace bssl
}

};
#endif

#endif
5 changes: 3 additions & 2 deletions src/client/BSSL_SSL_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_SSL_Client library v1.0.5 for Arduino devices.
* BSSL_SSL_Client library v1.0.6 for Arduino devices.
*
* Created August 6, 2003
* Created August 9, 2003
*
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
*
Expand Down Expand Up @@ -40,6 +40,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)

#include "BSSL_Helper.h"
Expand Down
11 changes: 3 additions & 8 deletions src/client/BSSL_SSL_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_SSL_Client library v1.0.5 for Arduino devices.
* BSSL_SSL_Client library v1.0.6 for Arduino devices.
*
* Created August 6, 2003
* Created August 9, 2003
*
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
*
Expand Down Expand Up @@ -38,9 +38,8 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)

#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)

#include <vector>
#include <memory>
Expand All @@ -50,10 +49,6 @@
#endif
#endif


#if !defined(FPSTR)
#define FPSTR
#endif
#if defined(USE_LIB_SSL_ENGINE)

#include "BSSL_Helper.h"
Expand Down
5 changes: 3 additions & 2 deletions src/client/BSSL_TCP_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_TCP_Client v2.0.6 for Arduino devices.
* BSSL_TCP_Client v2.0.7 for Arduino devices.
*
* Created August 8, 2023
* Created August 9, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -51,6 +51,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)

#include "BSSL_TCP_Client.h"
Expand Down
5 changes: 3 additions & 2 deletions src/client/BSSL_TCP_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_TCP_Client v2.0.6 for Arduino devices.
* BSSL_TCP_Client v2.0.7 for Arduino devices.
*
* Created August 8, 2023
* Created August 9, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -52,6 +52,7 @@

#include <Arduino.h>
#include "../ESP_SSLClient_FS.h"
#include "../ESP_SSLClient_Const.h"
#if defined(USE_LIB_SSL_ENGINE) || defined(USE_EMBED_SSL_ENGINE)

#include "BSSL_SSL_Client.h"
Expand Down

0 comments on commit 22fc8ea

Please sign in to comment.