Problems in get with esp-01

im receiving the following return with ESP01 in serial monitor:

Conectando ao Wi-Fi...
Conectando ao Wi-Fi...
Conectado ao Wi-Fi

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (28):
epc1=0x402212cd epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000004 depc=0x00000000

>>>stack>>>

ctx: bearssl
sp: 3fff0c80 end: 3fff0ea0 offset: 0150
3fff0dd0:  00000000 3fffc6fc 00000000 3ffef594  
3fff0de0:  402555fb 00003a98 3ffee86c 00000030  
3fff0df0:  deadbeef deadbeef deadbeef deadbeef  
3fff0e00:  deadbeef deadbeef deadbeef deadbeef  
3fff0e10:  deadbeef deadbeef 402559f1 deadbeef  
3fff0e20:  3fff2004 3fff288c 3fff27fc 3fff27f8  
3fff0e30:  deadbeef deadbeef 3fff1fe8 00000020  
3fff0e40:  00000020 deadbeef deadbeef deadbeef  
3fff0e50:  deadbeef deadbeef deadbeef 3fff2b04  
3fff0e60:  00000200 3fff2a04 3fff2004 4021f420  
3fff0e70:  3fff27e8 deadbeef 3fff2004 4021f80d  
3fff0e80:  000000e7 deadbeef deadbeef 3ffee86c  
3fff0e90:  00003a98 00000000 3ffef594 40201534  

ctx: cont
sp: 3ffffe10 end: 3fffffd0 offset: 0000
3ffffe10:  00003a98 00000000 00000000 402041ca  
3ffffe20:  00000200 3fff2a04 3fff2004 4021f420  
3ffffe30:  00000008 00000001 00001445 00000000  
3ffffe40:  3fff2504 40220578 3fff2004 00000000  
3ffffe50:  3fff2504 3ffe8916 3fff2004 3ffe8916  
3ffffe60:  00000000 00000001 3ffef594 4020421f  
3ffffe70:  00000000 00000001 3ffef594 4020440b  
3ffffe80:  00000000 000013a3 eac08312 0016b587  
3ffffe90:  00000000 00000000 00000034 000013a3  
3ffffea0:  00003a98 3fff10fc 3ffef594 40203573  
3ffffeb0:  3fff1ec4 3fffff00 3fffff6c 4020565c  
3ffffec0:  302e0031 3fffff6c 3fffff78 3ffee8e8  
3ffffed0:  000001bb 3ffe8916 3ffef594 402044ad  
3ffffee0:  40209660 87217559 40209660 87217559  
3ffffef0:  3ffef594 3ffe8630 3ffee7d0 4020120a  
3fffff00:  00000000 000004de 00000000 00000000  
3fffff10:  00000030 00000000 00000000 3fff0ffc  
3fffff20:  00000000 00000000 004e004f 00000000  
3fffff30:  00000000 0059005f 00000000 00000000  
3fffff40:  005a005f 00000000 00000000 0067006f  
3fffff50:  00000000 00000000 006c006f 00000000  
3fffff60:  00000000 0076007f 00000000 00000000  
3fffff70:  0077007f 00000000 3fff181c 0077007f  
3fffff80:  80000000 40252dfe 3fffffac 402020cd  
3fffff90:  3fffdad0 3ffef594 3fffffac 40201396  
3fffffa0:  00000001 3fff143c 3fff144c 00000000  
3fffffb0:  3fffdad0 00000000 3ffee8bc 40205e44  
3fffffc0:  feefeffe feefeffe 3fffdab0 40100d19  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 3424, room 16 
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8 
tail 0
chksum 0x2b
csum 0x2b
v000606d0
~ld
�a�n�r��n|��l�l`bbrl�nb�nl`�rl�l��Conectando ao Wi-Fi...
Conectando ao Wi-Fi...

my code is this

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiUdp.h>
#include "cert.h"

const char* ssid = "ssid";             // SSID da rede Wi-Fi
const char* password = "pass";  // Senha da rede Wi-Fi
const char* server = "site.com.br";
const char* idEquipamento = "id";
const int numSensor = 1;
const double valorMedido = 28;
const int grandeza = 1;

const long utcOffsetInSeconds = 0;  // Ajuste de fuso horário em segundos

WiFiClientSecure client;

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Conectando ao Wi-Fi...");
  }
  
  Serial.println("Conectado ao Wi-Fi");

  // Inicializa o cliente NTP
  configTime(utcOffsetInSeconds, 0, "pool.ntp.org");
  
  BearSSL::X509List certRootCACert(cert_Cloudflare_Inc_ECC_CA_3);
  BearSSL::PublicKey publicKey(pubkey_sni_cloudflaressl_com);

  client.setTrustAnchors(&certRootCACert);
  client.setKnownKey(&publicKey);

  sendDataToServer();
}

void sendDataToServer() {
  if (WiFi.status() == WL_CONNECTED) {

    // Construct the URL with query parameters
    String url = "/target.php?var1=" + String(var1) + "&var2=" + String(var2) + "&var3=" + String(var3) + "&var4=" + String(var4);

    if (client.connect(server, 443)) {
      client.print("GET " + url + " HTTP/1.1\r\n" +
                   "Host: " + server + "\r\n" +
                   "Connection: close\r\n\r\n");
    
      while (client.connected() || client.available()) {
        String line = client.readStringUntil('\n');
        Serial.println(line);
      }
      
      client.stop();
    }
  }
}

void loop() {
  // O programa não faz nada no loop neste exemplo
}

well it is using the usb adapter to go direct on pc, and before i put the trust anchor and the knownkey it was working, but is was using "client.setInsecure()"

Error 28 is an addressing error. Usually some sort of bad pointer (including going outside an array bound).
Run the exception decoder to get the source lines on the call stack and see if that gives a clue where things went wrong.

how can i run the exception decoder, i googled about but i did not found anything about (probably i searched in the wrong way but ok)

I don't know if it works with V2 versions of the IDE. You may have to install version 1.8.19.

There's also an online decoder I stumbled across. I've never used it myself but it might be worth a try.

https://maximeborges.github.io/esp-stacktrace-decoder/

try adding some println statements to identify the code with the problem, e.g.

 // Inicializa o cliente NTP
  configTime(utcOffsetInSeconds, 0, "pool.ntp.org");
   Serial.println("configTime done");
  BearSSL::X509List certRootCACert(cert_Cloudflare_Inc_ECC_CA_3);
 Serial.println("BearSSL::X509List certRootCACert done");

i think i fixed it by redoing all the code, now it is connecting normally, i think ive put the wrong cert and it just crashed everything