Failed to perform TLS handshake in Azure IOT hub

I am trying to connect my microcontroller device with azure iot hub using MQTT-TLS with x509 certificate.

But i am getting this error.

This could be one of several things. Please describe what you did to get the CA, create then sign the certificate, registering the certificate, etc. I can’t see that 4 is an mbedTLS error code, which TLS stack are you using?

I am using following instruction to create x509 certificate :
1] openssl req -outform PEM -x509 -sha256 -newkey rsa:4096 -keyout device-key.pem -out device-cert.pem -days 30 -extensions usr_cert -addext extendedKeyUsage=clientAuth -subj “/CN=my-x509-device”
2] openssl x509 -in device-cert.pem -text -noout
3] openssl rsa -in device-key.pem -out unencrypted-device-key.pem
TLS version is TLS 1.2

What about the CA, signing the certificate and registering the certificates? Overview of Azure IoT Hub X.509 CA security | Microsoft Learn

Is it required for individual enrollment

My reading of the link in my last post suggests it is.