Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
SSL support for Linux clients #1437
Conversation
This reverts commit b19ea13.
Hello @rustamserg ! Thanks for your contribution. Note though that this code is not called on the Linux platform; there we rely on asio's integration with OpenSSL that already does the right thing. Do you have a specific target use case for this? |
Hello @BillyONeal we don't use cpprest directly and thus cannot choose asio http client. Our network code is generated from swagger spec using swagger codegen for cpprest https://github.com/fraglab/swagger-codegen/tree/master/modules/swagger-codegen/src/main/resources/cpprest This implementation uses http client API not asio version. |
The http client on all non-Windows systems is powered by asio. We only have this platform specific callback for systems where the native TLS provider is not OpenSSL, and therefore OpenSSL can't validate the certificate chain (because it doesn't have the root certificates). See the caller here: Notably we have tests that we indeed reject bad certificates already here: which are passing on Linux. |
(Also notably, there's nothing calling this function you added right now) |
@BillyONeal thank you for the explanation, now I'm really confused. I just performed a test with setting breakpoint in this function under GDB to see where it is called. The top of the callstack as follows: So as I can see the callback is triggered in my case from http_client_asio.cpp:1084. However as I mentioned before our setup is not pure because of we use combination of swagger codegen + cpprest based auto generated code + Lumberyard engine environment which provides with asio and openssl libraries. If this PR is not actual then please ignore it. |
I'm not sure, your line numbers don't match up here :(
I see, that probably explains it, I'd be willing to bet the OpenSSL provided does not have trusted root certificates or is looking for them in the wrong place, meaning the real effect here is the
The PR might still be useful, I just want to be hyper paranoid on anything we merge related to TLS because it's security sensitive and make sure we understand everything going on here. |
Add x509 certificate chain validation for HTTP client on Linux OS