Trying latest aws iot sdk for C demos, can't establish a TLC connection

0

I have to update my mqtt client application with latest version of aws iot sdk, I tried a demo fouded in the sdk directory (mqtt_demo_basic_tls) i can built it and when executed It shown an error message: [ERROR] [Transport_OpenSSL_Sockets] [openssl_posix.c:280] SSL_connect failed to perform TLS handshake. [ERROR] [Transport_OpenSSL_Sockets] [openssl_posix.c:696] Failed to establish a TLS connection. I'm using broker path a3avgzpu0t174x-ats.iot.eu-central-1.amazonaws.com and default CACERT AmazonRootCA1.crt. what am I doing wrong?

질문됨 7달 전222회 조회
1개 답변
0

Hi. I think it's not obvious when you're new to the C-SDK, but you can't connect to AWS IoT Core using the basic TLS demo. You need to use the mutual auth demo. The basic TLS demo shows that the coreMQTT library can be used with brokers other than AWS IoT Core.

Please check the instructions here for using the mutual auth demo: https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/README.md#aws-iot-account-setup

profile pictureAWS
전문가
Greg_B
답변함 7달 전
  • Hi Greg, thank you for responding, I tried mutual auth demo with two different aws server path: xxxxxx-ats.iot.eu-central-1.amazonaws.com with related certificare and key, demo works xxxxxx.iot.eu-central-1.amazonaws.com with related certificare and key but demo doesn't work What could be different? I used the same Root CA (AmazonRootCA1.crt)

  • Hi Gabriele. The two endpoints present different server certificates, so you need a different root CA to validate each. The ATS endpoint is newer, and is what you should use. More information here: https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#endpoint-types

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인