Skip to content

fix(ssl): Pass CA bundle env vars to curl on macOS#3301

Open
chris-smith-zocdoc wants to merge 2 commits into
getsentry:masterfrom
chris-smith-zocdoc:cs_fix_certs
Open

fix(ssl): Pass CA bundle env vars to curl on macOS#3301
chris-smith-zocdoc wants to merge 2 commits into
getsentry:masterfrom
chris-smith-zocdoc:cs_fix_certs

Conversation

@chris-smith-zocdoc
Copy link
Copy Markdown

On macOS, sentry-cli links system libcurl which uses SecureTransport as its TLS backend. SecureTransport ignores SSL_CERT_FILE, so custom CA bundles (e.g. corporate MITM proxies) don't work even though openssl_probe sets the env var. This reads SSL_CERT_FILE (or CURL_CA_BUNDLE) back and passes it via CURLOPT_CAINFO, which SecureTransport does honor.

Previously we would get a TLS validation when running through our https proxy, like this

 error: API request failed

  Caused by:
      0: API request failed
      1: [60] SSL peer certificate or SSH remote key was not OK (SSL certificate problem: unable to get local issuer certificate)

Let me know if I should approach this differently or open an issue first to discuss this

On macOS, sentry-cli links system libcurl which uses SecureTransport as
its TLS backend. SecureTransport ignores SSL_CERT_FILE, so custom CA
bundles (e.g. corporate MITM proxies) don't work even though
openssl_probe sets the env var. This reads SSL_CERT_FILE (or
CURL_CA_BUNDLE) back and passes it via CURLOPT_CAINFO, which
SecureTransport does honor.

Generated with AI

Co-Authored-By: Claude Code
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3606bbf. Configure here.

Comment thread src/api/mod.rs
Match curl's native env var precedence. openssl_probe auto-populates
SSL_CERT_FILE with the system default, so checking it first would
shadow a user-specified CURL_CA_BUNDLE.

Generated with AI

Co-Authored-By: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant