Skip to content
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

POST SSL_get_peer_certificate #885

Closed
SuperElectron opened this issue Mar 7, 2023 · 3 comments
Closed

POST SSL_get_peer_certificate #885

SuperElectron opened this issue Mar 7, 2023 · 3 comments

Comments

@SuperElectron
Copy link

Description

I have been using the library for a while on Ubuntu 20.04 x86_64 and Nvidia Jetson Orin aarch64, but just recently I ran into this stack trace while making a simple https post (below).

The code is simple, and the installation on the Jetson Orin is the same.

  • from the stack trace below, HttpClient::cpr_post() is where the cpr post is made.

`*** SIGSEGV (@0x1000001b7) received by PID 1122 (TID 0xffff96e81900) from PID 439; stack trace: ***

@     0xffff999887c0 ([vdso]+0x7bf)

@     0xffff984a95b0 SSL_get_peer_certificate

@     0xffff985700c0 (unknown)

@     0xffff98572dac (unknown)

@     0xffff98573e2c (unknown)

@     0xffff9852393c (unknown)

@     0xffff98544dd4 (unknown)

@     0xffff98545f68 curl_multi_perform

@     0xffff9853cef0 curl_easy_perform

@     0xffff993d0d60 cpr::Session::DoEasyPerform()

@     0xffff993d1e3c cpr::Session::makeRequest()

@     0xffff993d4854 cpr::Session::Post()

@     0xaaaae2ab0890 cpr::Post<>()

@     0xaaaae2aa7df0 HttpClient::cpr_post()

@     0xaaaae2aa47b0 HttpClient::create_media_server_streams()

@     0xaaaae2a5d81c Mediator::notify()

@     0xaaaae2a6863c RadPipeline::create_media_server_streams_event()

@     0xaaaae2a4169c Application::run()

@     0xaaaae2a409c4 Application::exec()

@     0xaaaae2a30240 main

@     0xffff9873ae10 __libc_start_main
@     0xaaaae2a2f694 (unknown)`

Example/How to Reproduce

cpr::Response HttpClient::cpr_post(std::string uri, njson payload)
{
auto header = cpr::Header{{"content-type", "application/json"},
{"Authorization", "x-ms-date: something"},
{"log-type", "undefined"},
{"x-ms-date", make_timestamp()},
{"content-length", std::to_string(payload.dump().length())}};

auto body = cpr::Body(payload.dump());
response = cpr::Post(cpr::Url(uri), header, body);
return response;
}

Possible Fix

  • unknown

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

  • OS: ubuntu 20.04
  • platform: Nvidia Jetson Orin
    root@9558319e0635:/inference/build# cat /etc/os-release NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
  • curl version:
    root@9558319e0635:/# curl --version curl 7.68.0 (aarch64-unknown-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 Release-Date: 2020-01-08 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
@COM8
Copy link
Member

COM8 commented Mar 7, 2023

Thanks for reporting! What operating system are you using (distro)?
To me this looks like a bug where curl crashes since CA certs are invalid or not present.

There are two things you can try:

  1. Use a newer version of curl by installing your distros curl dev package (e.g. sudo dnf install libcurl-devel on fedora). Then when configuring pass the CPR_USE_SYSTEM_CURL option: cmake .. -DCPR_USE_SYSTEM_CURL=ON (or set it in CMake directly)
  2. Try reinstalling your distros ca-certs package. For example on arch: SSL certificate problem #445 (comment)

@COM8
Copy link
Member

COM8 commented Mar 17, 2023

Did those suggestions help you?

@COM8
Copy link
Member

COM8 commented Apr 4, 2023

Closing since no response. Feel free to reopen in case this is still an issue.

@COM8 COM8 closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants