opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Enable http(s) ssl verification for curl based http_client implementation

Open lalitb opened this issue 5 years ago • 9 comments
trafficstars

Currently, the curl based http client implementation (https://github.com/open-telemetry/opentelemetry-cpp/pull/385) doesn't support ssl( client and server) verification. This needs to be implemented.

lalitb avatar Nov 12 '20 13:11 lalitb

@lalitb - I am a bit concerned here. From libcurl perspective - if you install one coming with the distro with SSL support, the only difference is in https:// and http:// URL. The rest is handled by CURL in very opaque way, and you'd only need bindings to SSL cert check (optional). The rest is rather simple and intuitive. Do you mean installing the necessary dependencies, e.g. libcurl+openssl or libcurl+gnutls or alike? brew on Mac already installs CURL with SSL, and the one available in Apple should have SSL too. Same with Android OS (platform), which by default compiles CURL with BoringSSL.

Are you anticipating some code changes for this issue or just the build infra setup changes / CI changes?

maxgolov avatar Nov 17 '20 23:11 maxgolov

My point is we do not need to worry specifically about the TLS/SSL, unless there is a strong need to provide a callback for end-point certificate pinning / validation, and for the client authorization. Should this be more of a build infra item rather than a bug?

maxgolov avatar Nov 17 '20 23:11 maxgolov

@maxgolov - agree it should work seamlessly unless we want to support client authentication ( and hence provide Client certificate through our callback) which needs to be tested. The issue was actually raised to enable SSL (server ) certificate verification. I agree this is optional, but I am not sure if there are any security implication of bypassing this certificate check. Although traffic is still encrypted, there is no way to validate we are talking with correct server. I will anyway update the issue description.

lalitb avatar Nov 18 '20 02:11 lalitb

@lalitb - got it. We may also need to supplement the test server we have in our repo with TLS / SSL support too. That'd be quite a bit of work though.

maxgolov avatar Dec 01 '20 01:12 maxgolov

I've started some work on something related to this, because my organization needed ssl support in order to use the http exporter. The changes include the bare minimum that we needed to get things working, please advise on if its the correct approach and what we can do so we can contribute to the project.

https://github.com/open-telemetry/opentelemetry-cpp/pull/938

pavanshahm avatar Aug 03 '21 15:08 pavanshahm

@pavanshahm - Thanks for this. It would be good to have SSL certificate check integrated. Couple of comments here:

  1. Can we avoid adding code to build curl with SSL support as part of the otel-cpp build? I am not a bazel expert, but with cmake, we can build curl + SSL through vcpkg toolchain.
  2. instead of adding a certificate path, can we leverage the EventHandler class to pass the certificate: https://github.com/open-telemetry/opentelemetry-cpp/blob/dc25ea686707dee2ea993f49664abf2b88e6f58a/ext/include/opentelemetry/ext/http/client/http_client.h#L205

lalitb avatar Aug 03 '21 18:08 lalitb

This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.

github-actions[bot] avatar Nov 23 '21 01:11 github-actions[bot]

This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.

github-actions[bot] avatar Jan 23 '22 01:01 github-actions[bot]

This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.

github-actions[bot] avatar Mar 25 '22 02:03 github-actions[bot]

#1756 depends on it.

lalitb avatar Nov 09 '22 21:11 lalitb