-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL support for Linux clients #1437
base: master
Are you sure you want to change the base?
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:
|
(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