@@ -19,7 +19,7 @@ int WebSocketsNetworkClientSecure::connect(IPAddress ip, uint16_t port) {
1919 return 0 ;
2020}
2121
22- int WebSocketsNetworkClientSecure::connect (const char * host, uint16_t port) {
22+ int WebSocketsNetworkClientSecure::connect (const char * host, uint16_t port) {
2323 if (_impl->gsm_client_secure_ ) {
2424 return _impl->gsm_client_secure_ ->connect (host, port);
2525 } else if (_impl->wifi_client_secure_ ) {
@@ -28,7 +28,7 @@ int WebSocketsNetworkClientSecure::connect(const char *host, uint16_t port) {
2828 Serial.println (_impl->no_interface_error_ );
2929 return 0 ;
3030}
31- int WebSocketsNetworkClientSecure::connect (const char * host, uint16_t port,
31+ int WebSocketsNetworkClientSecure::connect (const char * host, uint16_t port,
3232 int32_t timeout_ms) {
3333 if (_impl->gsm_client_secure_ ) {
3434 // Ignore timeout as will cause read() to block for specified time
@@ -50,7 +50,7 @@ size_t WebSocketsNetworkClientSecure::write(uint8_t data) {
5050 return 0 ;
5151}
5252
53- size_t WebSocketsNetworkClientSecure::write (const uint8_t * buf, size_t size) {
53+ size_t WebSocketsNetworkClientSecure::write (const uint8_t * buf, size_t size) {
5454 if (_impl->gsm_client_secure_ ) {
5555 return _impl->gsm_client_secure_ ->write (buf, size);
5656 } else if (_impl->wifi_client_secure_ ) {
@@ -60,12 +60,12 @@ size_t WebSocketsNetworkClientSecure::write(const uint8_t *buf, size_t size) {
6060 return 0 ;
6161}
6262
63- size_t WebSocketsNetworkClientSecure::write (const char * str) {
63+ size_t WebSocketsNetworkClientSecure::write (const char * str) {
6464 const int size = strlen (str);
6565 if (_impl->gsm_client_secure_ ) {
66- return _impl->gsm_client_secure_ ->write ((const uint8_t *)str, size);
66+ return _impl->gsm_client_secure_ ->write ((const uint8_t *)str, size);
6767 } else if (_impl->wifi_client_secure_ ) {
68- return _impl->wifi_client_secure_ ->write ((const uint8_t *)str, size);
68+ return _impl->wifi_client_secure_ ->write ((const uint8_t *)str, size);
6969 }
7070 Serial.println (_impl->no_interface_error_ );
7171 return 0 ;
@@ -91,7 +91,7 @@ int WebSocketsNetworkClientSecure::read() {
9191 return 0 ;
9292}
9393
94- int WebSocketsNetworkClientSecure::read (uint8_t * buf, size_t size) {
94+ int WebSocketsNetworkClientSecure::read (uint8_t * buf, size_t size) {
9595 if (_impl->gsm_client_secure_ ) {
9696 return _impl->gsm_client_secure_ ->read (buf, size);
9797 } else if (_impl->wifi_client_secure_ ) {
@@ -149,29 +149,40 @@ WebSocketsNetworkClientSecure::operator bool() {
149149 return 0 ;
150150}
151151
152- void WebSocketsNetworkClientSecure::setCACert (const char * rootCA) {
152+ void WebSocketsNetworkClientSecure::setCACert (const char * rootCA) {
153153 if (_impl->gsm_client_secure_ ) {
154- return _impl->gsm_client_secure_ ->setCertificate (rootCA);
154+ return _impl->gsm_client_secure_ ->setCACert (rootCA);
155155 } else if (_impl->wifi_client_secure_ ) {
156156 return _impl->wifi_client_secure_ ->setCACert (rootCA);
157157 }
158158 Serial.println (_impl->no_interface_error_ );
159159}
160160
161- #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4)
162- void WebSocketsNetworkClientSecure::setCACertBundle (const uint8_t *bundle,
163- size_t bundle_size) {
164- #else
165- void WebSocketsNetworkClientSecure::setCACertBundle (const uint8_t *bundle) {
166- #endif
161+ void WebSocketsNetworkClientSecure::setCACertBundle (const uint8_t * bundle_start,
162+ const size_t bundle_size) {
167163 if (_impl->gsm_client_secure_ ) {
168- return _impl->gsm_client_secure_ ->setCACertBundle (bundle );
164+ return _impl->gsm_client_secure_ ->setCACertBundle (bundle_start );
169165 } else if (_impl->wifi_client_secure_ ) {
170- #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4)
171- return _impl->wifi_client_secure_ ->setCACertBundle (bundle, bundle_size);
172- #else
173- return _impl->wifi_client_secure_ ->setCACertBundle (bundle);
174- #endif
166+ return _impl->wifi_client_secure_ ->setCACertBundle (bundle_start,
167+ bundle_size);
168+ }
169+ Serial.println (_impl->no_interface_error_ );
170+ }
171+
172+ void WebSocketsNetworkClientSecure::setCertificate (const char * client_ca) {
173+ if (_impl->gsm_client_secure_ ) {
174+ return _impl->gsm_client_secure_ ->setCertificate (client_ca);
175+ } else if (_impl->wifi_client_secure_ ) {
176+ _impl->wifi_client_secure_ ->setCertificate (client_ca);
177+ }
178+ Serial.println (_impl->no_interface_error_ );
179+ }
180+
181+ void WebSocketsNetworkClientSecure::setPrivateKey (const char * private_key) {
182+ if (_impl->gsm_client_secure_ ) {
183+ return _impl->gsm_client_secure_ ->setPrivateKey (private_key);
184+ } else if (_impl->wifi_client_secure_ ) {
185+ _impl->wifi_client_secure_ ->setPrivateKey (private_key);
175186 }
176187 Serial.println (_impl->no_interface_error_ );
177188}
@@ -185,8 +196,8 @@ void WebSocketsNetworkClientSecure::setInsecure() {
185196 Serial.println (_impl->no_interface_error_ );
186197}
187198
188- bool WebSocketsNetworkClientSecure::verify (const char * fingerprint,
189- const char * domain_name) {
199+ bool WebSocketsNetworkClientSecure::verify (const char * fingerprint,
200+ const char * domain_name) {
190201 if (_impl->gsm_client_secure_ ) {
191202 // Simply calling SSLClient::verify() will break TLS handshake
192203 // Can be skipped as verification is done by SSLClient itself,
0 commit comments