aws / aws-iot-device-sdk-cpp

SDK for connecting to AWS IoT from a device using C++
http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com
Apache License 2.0
123 stars 111 forks source link

OpenSSL wrapper is stuck and leading to connection time out #201

Closed Sourabh-ALTEN closed 2 years ago

Sourabh-ALTEN commented 2 years ago

Describe the bug

I have an application developed using aws-iot sdk and it was working fine earlier. Now while connecting to aws the OpenSSL wrapper is stuck at ConnectTCPSocket:L271 But it says it could resolve the endpoint and after sometime it time outs. There was a similar issue https://github.com/aws/aws-iot-device-sdk-cpp/issues/5 but in my case network is available. Device is connected to network and also ping to aws endpoint is working.

Can anyone please let me know what could be the issue here and how to resolve it?

Expected Behavior

Successful connection to aws backend

Current Behavior

OpenSSL wrapper is stuck at ConnectTCPSocket:L271

Reproduction Steps

.

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1

Environment details (OS name and version, etc.)

Client application is running on Linux based embedded platform

jmklix commented 2 years ago

Which version of OpenSSL are you using? How often does this happen? Is it possible that your device is temporarily loosing connection?

Sourabh-ALTEN commented 2 years ago

Hello @jmklix , OpenSSL version on device is 1.1.1k. This is happening for the first time. I have tried with multiple network connections but it's the same situation. Is there any way I could check if this is related to dns resolving and network problem?

jmklix commented 2 years ago

Enabling the logs might let us figure out what is happening. You can do that with the following:

std::shared_ptr<awsiotsdk::util::Logging::ConsoleLogSystem> p_log_system =
    std::make_shared<awsiotsdk::util::Logging::ConsoleLogSystem>(awsiotsdk::util::Logging::LogLevel::Info);
awsiotsdk::util::Logging::InitializeAWSLogging(p_log_system);
Sourabh-ALTEN commented 2 years ago

Hello @jmklix logging is already enabled and the above code is already part of main()

jmklix commented 2 years ago

You could try to reproduce it on a different device and network.

Nothing has changed with this sdk recently, so it probably isn't something caused by the sdk. Can you provide a minimal code sample and logs that reproduces your connection time out?

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.