Skip to content

Commit fec1491

Browse files
fix: Support self-signed SSL certs in macOS keychain (arm64) (#3057)
### Description Fix a regression introduced with the `curl-sys` dependency bump in [2.56.1](https://github.com/getsentry/sentry-cli/releases/tag/2.56.1); the dependency removed support for Secure Transport in libcurl, switching the default to OpenSSL, which was statically linked via the `static-ssl` feature flag. This statically-linked version lacks support for reading trusted certificates from the macOS Keychain. In this PR, we swap the statically-linked curl (and statically linked OpenSSL) for dynamically linking libcurl on macOS only (keeping the statically linked libraries for other platforms). Since curl is built into macOS, introducing this runtime dependency hopefully will not break anyone. And, since the built-in libcurl does read certs from the macOS Keychain, this should fix the regression from version 2.56.1. ### Issues - Resolves #3054 - Resolves [CLI-256](https://linear.app/getsentry/issue/CLI-256/self-signed-certificate-problem-since-2561)
1 parent 8cad066 commit fec1491

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Fixed a bug on ARM-based macOS systems that prevented Sentry CLI from respecting self-signed certificates trusted in the macOS keychain ([#3057](https://github.com/getsentry/sentry-cli/issues/3057)).
8+
39
## 3.0.1
410

511
### Performance Improvements

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ clap = { version = "4.1.6", default-features = false, features = [
2424
] }
2525
clap_complete = "4.4.3"
2626
console = "0.15.5"
27-
curl = { version = "0.4.46", features = ["static-curl", "static-ssl"] }
27+
curl = { version = "0.4.46" }
2828
dirs = "4.0.0"
2929
dotenvy = "0.15.7"
3030
elementtree = "1.2.3"
@@ -127,6 +127,12 @@ openssl-probe = "0.1.5"
127127
[target."cfg(windows)".dependencies]
128128
windows-sys = { version = "0.59.0", features = ["Win32_Storage_FileSystem"] }
129129

130+
# Use static curl/SSL on all platforms except ARM-based macOS.
131+
# We link dynamically on ARM macOS; that way we can support self-signed certificates
132+
# trusted in the macOS keychain.
133+
[target."cfg(not(all(target_os = \"macos\", target_arch = \"aarch64\")))".dependencies]
134+
curl = { version = "0.4.46", features = ["static-curl", "static-ssl"] }
135+
130136
# We optimize the release build for size.
131137
[profile.release]
132138
opt-level = 2 # I obtained the smallest binary size with opt-level 2 on my system.

0 commit comments

Comments
 (0)