Closed trahman-khan closed 4 years ago
Thanks for tracking this down. If you'd like to make a PR, we can take a look. But if we're transitioning to getaddrinfo it might be nice to add IPv6 support as well.
Thanks for the feedback. I was about to create the PR but then realized that the master branch has the fix already.
Hi, I have cross-compiled the SDK (1.4.0 version from https://github.com/aws/aws-iot-device-sdk-cpp/tree/release) with an armv5 gcc-7.4 toolchain. After setting up the certificates and SampleConfig.json file, I tried to run the sample application pub-sub-sample but, found that the gethostbyname() function that is called inside the network/OpenSSL/OpenSSLConnection.cpp file always returns NULL. The glibc version is 2.29 on my machine. The man page http://man7.org/linux/man-pages/man3/gethostbyname.3.html says this function is obsolete, use other functions like getaddrinfo(). I have modified the OpenSSLConnection.cpp with getaddrinfo() for IPv4 and it seems to be working fine:
Please let me know if anybody has any feedback or question. I want to create a PR for this issue.