module

Noir::MacosCA

The macOS release tarballs bundle Homebrew's libssl/libcrypto (packaging/macos/package.sh). Their compiled-in OPENSSLDIR still points at the Homebrew prefix, so on a Mac without Homebrew OpenSSL loads no CA certificates and every verified HTTPS request fails (#3197). macOS ships its own bundle at /etc/ssl/cert.pem; load it as well.

This hooks the context rather than setting SSL_CERT_FILE: an exported variable would reach every child noir starts (ACP agents, git, $EDITOR), and tools that read it as their only trust store would stop consulting the Keychain.

Constants

SYSTEM_CERT_FILE = "/etc/ssl/cert.pem"

Class methods

fallback_cert_file(env : Hash(String, String) | ENV.class, default_file : String, system_file : String = SYSTEM_CERT_FILE) : String | Nil

The bundle to add, or nil to leave OpenSSL alone: the user already chose a location, OpenSSL's own default exists (a Homebrew install), or there is no system bundle to fall back to. An empty variable is unset, which is how OpenSSL fails on it too: it loads nothing.

Source