microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
8.02k stars 1.66k forks source link

SSL handshake error on ARM64 #369

Open mabruce opened 7 years ago

mabruce commented 7 years ago

I'm trying to call a REST endpoint over HTTPS from a Linux/ARM64 system (Jetson TX1). Regular http get works fine, but https is failing with "Error in SSL handshake". Further digging into the error code yields "generic:336134278". Curl and wget work so it's not a DNS issue, and a get request for google.com comes up with the error so it's not a lesser-known-cert problem.

The example code below works on Linux/x64 but fails on the ARM system.

try {
    http_client cl("https://www.google.com");
    auto response = cl.request(methods::GET, "/").get();
}
catch (http_exception& e) { std::cerr << e.what() << std::endl << e.error_code() << std::endl; }

Return:

Error in SSL handshake
generic:336134278

Edit: The failure is both with a fresh compile from current source (static, using statically compiled Boost 1.63), and with the Ubuntu 16.04 aarch64 version in the apt repositories (shared, using apt's shared Boost 1.58).

rpmunoz commented 7 years ago

I found the same error after compiling a sample C++ code in Jetson TX1. Everything works ok in x64 but fails on the ARM system.

I partially solved the problem adding the following lines

http_client_config config; config.set_validate_certificates(false); auto client = http_client(url, config);