@@ -304,18 +304,18 @@ class URLStreamESP32 : public AbstractURLStream {
304304 // / Defines the read buffer size
305305 void setReadBufferSize (int size) { buffer_size = size; }
306306
307- // / Define the Root PEM Certificate for SSL: the last byte must be null
307+ // / Define the Root PEM Certificate for SSL: the last byte must be null, the len is including the ending null
308308 void setCACert (const uint8_t * cert, int len) {
309309 pem_cert_len = len;
310310 pem_cert = cert;
311311 // certificate must end with traling null
312- assert (cert[len]==0 );
312+ assert (cert[len- 1 ]==0 );
313313 }
314314
315315 // / Define the Root PEM Certificate for SSL: Method compatible with Arduino WiFiClientSecure API
316316 void setCACert (const char * cert){
317317 int len = strlen (cert);
318- setCACert ((const uint8_t *)cert, len);
318+ setCACert ((const uint8_t *)cert, len+ 1 );
319319 }
320320
321321 protected:
@@ -335,17 +335,17 @@ class URLStreamESP32 : public AbstractURLStream {
335335 LOGI (" HTTP_EVENT_ERROR" );
336336 break ;
337337 case HTTP_EVENT_ON_CONNECTED:
338- LOGI (" HTTP_EVENT_ON_CONNECTED" );
338+ LOGD (" HTTP_EVENT_ON_CONNECTED" );
339339 break ;
340340 case HTTP_EVENT_HEADER_SENT:
341- LOGI (" HTTP_EVENT_HEADER_SENT" );
341+ LOGD (" HTTP_EVENT_HEADER_SENT" );
342342 break ;
343343 case HTTP_EVENT_ON_HEADER:
344- LOGI (" HTTP_EVENT_ON_HEADER, key=%s, value=%s" , evt->header_key ,
344+ LOGD (" HTTP_EVENT_ON_HEADER, key=%s, value=%s" , evt->header_key ,
345345 evt->header_value );
346346 break ;
347347 case HTTP_EVENT_ON_DATA:
348- LOGI (" HTTP_EVENT_ON_DATA, len=%d" , evt->data_len );
348+ LOGD (" HTTP_EVENT_ON_DATA, len=%d" , evt->data_len );
349349 break ;
350350 case HTTP_EVENT_ON_FINISH:
351351 LOGI (" HTTP_EVENT_ON_FINISH" );
0 commit comments