@@ -304,18 +304,18 @@ class URLStreamESP32 : public AbstractURLStream {
304
304
// / Defines the read buffer size
305
305
void setReadBufferSize (int size) { buffer_size = size; }
306
306
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
308
308
void setCACert (const uint8_t * cert, int len) {
309
309
pem_cert_len = len;
310
310
pem_cert = cert;
311
311
// certificate must end with traling null
312
- assert (cert[len]==0 );
312
+ assert (cert[len- 1 ]==0 );
313
313
}
314
314
315
315
// / Define the Root PEM Certificate for SSL: Method compatible with Arduino WiFiClientSecure API
316
316
void setCACert (const char * cert){
317
317
int len = strlen (cert);
318
- setCACert ((const uint8_t *)cert, len);
318
+ setCACert ((const uint8_t *)cert, len+ 1 );
319
319
}
320
320
321
321
protected:
@@ -335,17 +335,17 @@ class URLStreamESP32 : public AbstractURLStream {
335
335
LOGI (" HTTP_EVENT_ERROR" );
336
336
break ;
337
337
case HTTP_EVENT_ON_CONNECTED:
338
- LOGI (" HTTP_EVENT_ON_CONNECTED" );
338
+ LOGD (" HTTP_EVENT_ON_CONNECTED" );
339
339
break ;
340
340
case HTTP_EVENT_HEADER_SENT:
341
- LOGI (" HTTP_EVENT_HEADER_SENT" );
341
+ LOGD (" HTTP_EVENT_HEADER_SENT" );
342
342
break ;
343
343
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 ,
345
345
evt->header_value );
346
346
break ;
347
347
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 );
349
349
break ;
350
350
case HTTP_EVENT_ON_FINISH:
351
351
LOGI (" HTTP_EVENT_ON_FINISH" );
0 commit comments