Skip to content

Commit 3606bbf

Browse files
fix(ssl): Pass CA bundle env vars to curl on macOS
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
1 parent 2624b8d commit 3606bbf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/api/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@ impl Api {
242242
handle.ssl_verify_host(self.config.should_verify_ssl())?;
243243
handle.ssl_verify_peer(self.config.should_verify_ssl())?;
244244

245+
if let Ok(ca_bundle) = std::env::var("SSL_CERT_FILE") {
246+
handle.cainfo(&ca_bundle)?;
247+
} else if let Ok(ca_bundle) = std::env::var("CURL_CA_BUNDLE") {
248+
handle.cainfo(&ca_bundle)?;
249+
}
250+
245251
let env = self.config.get_pipeline_env();
246252
let headers = self.config.get_headers();
247253

0 commit comments

Comments
 (0)