diff --git a/src/Arduino_ConnectionHandler.h b/src/Arduino_ConnectionHandler.h index 0e6cb70..7ece188 100644 --- a/src/Arduino_ConnectionHandler.h +++ b/src/Arduino_ConnectionHandler.h @@ -241,6 +241,7 @@ class ConnectionHandler { virtual unsigned long getTime() = 0; virtual Client &getClient() = 0; virtual Client *getNewClient() = 0; + virtual Client *getNewSSLClient() = 0; virtual UDP &getUDP() = 0; #endif diff --git a/src/Arduino_EthernetConnectionHandler.cpp b/src/Arduino_EthernetConnectionHandler.cpp index 0753eb2..7ac6c24 100644 --- a/src/Arduino_EthernetConnectionHandler.cpp +++ b/src/Arduino_EthernetConnectionHandler.cpp @@ -19,6 +19,7 @@ #include "Arduino_EthernetConnectionHandler.h" #ifdef BOARD_HAS_ETHERNET /* Only compile if the board has ethernet */ +#include "EthernetSSLClient.h" /****************************************************************************** CTOR/DTOR @@ -126,4 +127,8 @@ NetworkConnectionState EthernetConnectionHandler::update_handleDisconnected() } } +Client* EthernetConnectionHandler::getNewSSLClient() { + return new EthernetSSLClient(); +} + #endif /* #ifdef BOARD_HAS_ETHERNET */ diff --git a/src/Arduino_EthernetConnectionHandler.h b/src/Arduino_EthernetConnectionHandler.h index eb8aecd..ef049be 100644 --- a/src/Arduino_EthernetConnectionHandler.h +++ b/src/Arduino_EthernetConnectionHandler.h @@ -39,6 +39,7 @@ class EthernetConnectionHandler : public ConnectionHandler virtual unsigned long getTime() override { return 0; } virtual Client & getClient() override{ return _eth_client; } virtual Client *getNewClient() override { return new EthernetClient(); } + virtual Client *getNewSSLClient(); virtual UDP & getUDP() override { return _eth_udp; } diff --git a/src/Arduino_GSMConnectionHandler.cpp b/src/Arduino_GSMConnectionHandler.cpp index e57a720..3629a9b 100644 --- a/src/Arduino_GSMConnectionHandler.cpp +++ b/src/Arduino_GSMConnectionHandler.cpp @@ -145,4 +145,12 @@ NetworkConnectionState GSMConnectionHandler::update_handleDisconnected() } } +Client* GSMConnectionHandler::getNewSSLClient() { +#ifdef ARDUINO_SAMD_MKRGSM1400 + return GSMSSLClient(); +#else + return nullptr; +#endif +} + #endif /* #ifdef BOARD_HAS_GSM */ diff --git a/src/Arduino_GSMConnectionHandler.h b/src/Arduino_GSMConnectionHandler.h index bf71d49..ed4f615 100644 --- a/src/Arduino_GSMConnectionHandler.h +++ b/src/Arduino_GSMConnectionHandler.h @@ -41,6 +41,7 @@ class GSMConnectionHandler : public ConnectionHandler virtual unsigned long getTime() override; virtual Client & getClient() override { return _gsm_client; }; virtual Client *getNewClient() override { return new GSMClient(); } + virtual Client *getNewSSLClient(); virtual UDP & getUDP() override { return _gsm_udp; }; diff --git a/src/Arduino_NBConnectionHandler.cpp b/src/Arduino_NBConnectionHandler.cpp index 344e104..3e16520 100644 --- a/src/Arduino_NBConnectionHandler.cpp +++ b/src/Arduino_NBConnectionHandler.cpp @@ -147,4 +147,8 @@ NetworkConnectionState NBConnectionHandler::update_handleDisconnected() } } +Client* NBConnectionHandler::getNewSSLClient() { + return new NBSSLClient(); +} + #endif /* #ifdef BOARD_HAS_NB */ diff --git a/src/Arduino_NBConnectionHandler.h b/src/Arduino_NBConnectionHandler.h index caa15fb..e2a34ee 100644 --- a/src/Arduino_NBConnectionHandler.h +++ b/src/Arduino_NBConnectionHandler.h @@ -42,6 +42,7 @@ class NBConnectionHandler : public ConnectionHandler virtual unsigned long getTime() override; virtual Client & getClient() override { return _nb_client; }; virtual Client *getNewClient() override { return new NBClient(); } + virtual Client *getNewSSLClient(); virtual UDP & getUDP() override { return _nb_udp; }; diff --git a/src/Arduino_WiFiConnectionHandler.cpp b/src/Arduino_WiFiConnectionHandler.cpp index 902b53f..7932118 100644 --- a/src/Arduino_WiFiConnectionHandler.cpp +++ b/src/Arduino_WiFiConnectionHandler.cpp @@ -20,8 +20,23 @@ ******************************************************************************/ #include "Arduino_WiFiConnectionHandler.h" - #ifdef BOARD_HAS_WIFI /* Only compile if the board has WiFi */ +#if defined(BOARD_STM32H7) + #include +#elif defined(ARDUINO_ARCH_ESP32) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(BOARD_HAS_SE050) + #include +#endif + +#ifdef BOARD_HAS_OFFLOADED_ECCX08 +#include +#include +#endif /****************************************************************************** CONSTANTS @@ -170,4 +185,12 @@ NetworkConnectionState WiFiConnectionHandler::update_handleDisconnected() } } +Client* WiFiConnectionHandler::getNewSSLClient() { +#ifdef ARDUINO_ARCH_ESP32 + return new WiFiClientSecure(); +#else + return new WiFiSSLClient(); +#endif +} + #endif /* #ifdef BOARD_HAS_WIFI */ diff --git a/src/Arduino_WiFiConnectionHandler.h b/src/Arduino_WiFiConnectionHandler.h index 31f6a5a..e346ef3 100644 --- a/src/Arduino_WiFiConnectionHandler.h +++ b/src/Arduino_WiFiConnectionHandler.h @@ -40,6 +40,7 @@ class WiFiConnectionHandler : public ConnectionHandler virtual unsigned long getTime() override; virtual Client & getClient() override { return _wifi_client; } virtual Client *getNewClient() override { return new WiFiClient(); } + virtual Client *getNewSSLClient(); virtual UDP & getUDP() override { return _wifi_udp; }