HTTPS client GET request getUpdates api telegram bot fail

We have developed a small program that check periodically for new messages in our telegram bot.
Our software is developed using esp idf 5.0 on ESP32-S3 wroom module.
We started by using a certificate downloaded from the Internet that works properly.
Now that we have verified our software we want to replace the (selfsigned) certificate we used with our own certificate created through openssl but we can’t get things to work.
As soon as we replace the certificate the communication fails because of the certificate verification fail with this error

I (35499) mbedtls: ssl_tls.c:3007 client state: MBEDTLS_SSL_SERVER_CERTIFICATE

I (35509) mbedtls: ssl_tls.c:6495 => parse certificate

I (35519) mbedtls: ssl_msg.c:3842 => read record

I (35519) mbedtls: ssl_msg.c:1800 => fetch input

I (35529) mbedtls: ssl_msg.c:1955 in_left: 0, nb_want: 5

I (35539) mbedtls: ssl_msg.c:1980 in_left: 0, nb_want: 5

I (35539) mbedtls: ssl_msg.c:1983 ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)

I (35549) mbedtls: ssl_msg.c:2003 <= fetch input

I (35559) mbedtls: ssl_msg.c:1800 => fetch input

I (35559) mbedtls: ssl_msg.c:1955 in_left: 5, nb_want: 5137

I (35569) mbedtls: ssl_msg.c:1980 in_left: 5, nb_want: 5137

I (35569) mbedtls: ssl_msg.c:1983 ssl->f_recv(_timeout)() returned 5132 (-0xffffebf4)

I (35579) mbedtls: ssl_msg.c:2003 <= fetch input

I (35589) mbedtls: ssl_msg.c:3916 <= read record

W (35689) mbedtls: ssl_tls.c:6319 x509_verify_cert() returned -9984 (-0x2700)

I (35689) mbedtls: ssl_msg.c:4871 => send alert message

I (35689) mbedtls: ssl_msg.c:2633 => write record

I (35699) mbedtls: ssl_msg.c:2016 => flush output

I (35699) mbedtls: ssl_msg.c:2034 message length: 7, out_left: 7

I (35709) mbedtls: ssl_msg.c:2041 ssl->f_send() returned 7 (-0xfffffff9)

I (35719) mbedtls: ssl_msg.c:2069 <= flush output

I (35719) mbedtls: ssl_msg.c:2777 <= write record

I (35729) mbedtls: ssl_msg.c:4884 <= send alert message

I (35729) mbedtls: ssl_tls.c:3098 <= handshake

E (35739) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (35749) esp-tls-mbedtls: Failed to verify peer certificate!

Is there something wrong that we can’t figure out can someone help us out ?
Our openssl certificate options seems identical to the working certificate we have set also the same subject and issuer data but verification always fail
Below the two certificate
Working certificate

-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz
NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE
AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD
E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH
/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy
DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh
GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR
tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA
AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD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