I'm trying to build the crashpad repo for Android to enable my application with crash reports. The crash reports will be submitted to a Backtrace server and I would like to ensure that the upload is using https.
Am I correct in saying there's no support from crashpad for HTTPS on Android "out of the box"?
Looking at the Backtrace fork, one can make usage of the root_cert_path
parameter to pass a path to a location where a .pem file exists. Is this what is expected when using HTTPS transport in crashpad for Android?
Also, Backtrace's fork offers prebuilt .so on Github for Android, and they crash at runtime as the path to the file is hardcoded with a backslash in front not making if a relative path which fails a check later on.
If possible, I would like to learn the "best practice" approach here to use crashpad with https in my android application.
Thank you
I tried:
- Building the repo with these settings
target_os = "android"target_cpu = "arm64"android_ndk_root = "~/android-ndk-r21e"android_api_level = 29is_debug = true
Then, I hit this code:
// crashpad/util/net/http_transport_socket.cc#if !defined(CRASHPAD_USE_BORINGSSL) CHECK(scheme == "http") << "Got " << scheme << " for scheme in '" << url()<< "'";#endif
As I was passing a https url.
- Building with
CRASHPAD_USE_BORINGSSL
and making sure to link to openssl libs and have the needed includes.
Then I hit this code:
// crashpad/util/net/http_transport_socket.cc if (!root_cert_path.empty()) { if (SSL_CTX_load_verify_locations( ctx_.get(), root_cert_path.value().c_str(), nullptr) <= 0) { LOG(ERROR) << "SSL_CTX_load_verify_locations"; return false; } } else {#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (SSL_CTX_load_verify_locations( ctx_.get(), nullptr, "/etc/ssl/certs") <= 0) { LOG(ERROR) << "SSL_CTX_load_verify_locations"; return false; }#elif BUILDFLAG(IS_FUCHSIA) if (SSL_CTX_load_verify_locations( ctx_.get(), "/config/ssl/cert.pem", nullptr) <= 0) { LOG(ERROR) << "SSL_CTX_load_verify_locations"; return false; }#else#error cert store location#endif
Which throws a build error since for IS_ANDROID, the #else
case if executed.