std.crypto.Certificate.Bundle/macos: rescanMac picks non-default keychain to pull certificates from #21106
Labels
bug
Observed behavior contradicts documented or intended behavior
os-macos
standard library
This issue involves writing Zig code for the standard library.
Milestone
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
rescanMac
populates the system cert pool by reading from the keychain at/System/Library/Keychains/SystemRootCertificates.keychain
. When I query my system's keychains, this isn't listed:This causes problems on my work computer, which sits behind an SSL-intercepting proxy. I believe the proxy installed its root CA to one of these keychains, but not to the one which is hardcoded in
rescanMac
, which leads toTlsInitializationFailed
errors forstd.http.Client
requests. This also means thatzig build
fails when fetching dependencies.Expected Behavior
It's unclear to me whether "fault" here belongs to
std.crypto.Certificate.Bundle
for only checking on spot for the keychain, or to the proxy for installing its root CA to the keychain in/System
.Regardless, I think there are a couple of things that could be done:
/usr/bin/security
to query for which keychain(s) to use, or invoke Apple'sSecurity.framework
APIs directly/System/Library/Frameworks/Security.framework/Versions/A/Security
using std.DynLib?CURL_CA_BUNDLE
variableThe text was updated successfully, but these errors were encountered: