AWS embedded C SDK - Cannot connect

0

Hi,

I have an ESP32 board which connects successfully to AWS IoT, publish messages and receives messages from subscribed topics, using Amazon certificates.

I cannot connect using AWS embedded C SDK using same certificates. Any connect using certificates end up this way:

[INFO] [DEMO] [mqtt_demo_mutual_auth.c:584] Establishing a TLS session to XXXXXXXXXXXXXXXXX.iot.eu-west-1.amazonaws.com:8883.
[INFO] [DEMO] [mqtt_demo_mutual_auth.c:1264] Creating an MQTT connection to XXXXXXXXXXXXXXXXX.iot.eu-west-1.amazonaws.com.
[ERROR] [Transport_OpenSSL_Sockets] [openssl_posix.c:696] Failed to receive data over network: SSL_read failed: ErrorStatus=EVP lib.
..................... (huge numbers of lines like one above)........................................................................................................................................
[ERROR] [Transport_OpenSSL_Sockets] [openssl_posix.c:696] Failed to receive data over network: SSL_read failed: ErrorStatus=EVP lib.
[ERROR] [Transport_OpenSSL_Sockets] [openssl_posix.c:696] Failed to receive data over network: SSL_read failed: ErrorStatus=EVP lib.
[ERROR] [MQTT] [core_mqtt.c:1531] CONNACK recv failed with status = MQTTNoDataAvailable.
[ERROR] [MQTT] [core_mqtt.c:1802] MQTT connection failed with status = MQTTNoDataAvailable.
[ERROR] [SHADOW_DEMO] [shadow_demo_helpers.c:604] Connection with MQTT broker failed with status 7.
[ERROR] [SHADOW] [shadow_demo_main.c:528] Failed to connect to MQTT broker.

Any help is appreciated.

Regards,
Pavel

ptonev
asked 4 years ago813 views
2 Answers
0

Hi,

The long stack with thousands of messages like "Failed to receive data over network: SSL_read failed: ErrorStatus=EVP lib." is caused by any inconsistency in AWS IoT Policy. Once it is fixed everything is working fine.

Regards,
Pavel

ptonev
answered 4 years ago
0

Thanks Pavel,

I've just had exactly the same problem and as soon as I attached the policy to the certificate it worked.

Carl

cdp
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions