Company certificates
On a network that inspects traffic, such as a company office or a VPN, a proxy signs every secure connection with a private certificate. Your administrator installs that certificate in the macOS System keychain, so browsers trust it.
Command-line tools such as git, Homebrew’s curl, mise, and Python’s requests do not trust the certificate, because they read their own lists of trusted certificates. They fail with errors such as “self signed certificate in certificate chain”.
If the Mac has certificates that an administrator trusts as roots, teeup makes a PEM certificate bundle from Apple’s public roots and these certificates. It does not use a certificate marked Never Trust. Then it configures your shell and its own commands to use the bundle. On a Mac without company certificates, teeup does nothing.
How it works
You do not need to do anything. teeup makes the bundle during ./bootstrap, and makes it again at the start of every teeup update, before it connects to the network. teeup puts the bundle in ~/.local/state/teeup/ca-bundle.pem. The bundle works on every network because it has the public roots and the company certificates.
teeup sets these environment variables to configure the tools:
SSL_CERT_FILEGIT_SSL_CAINFOCURL_CA_BUNDLEREQUESTS_CA_BUNDLENODE_EXTRA_CA_CERTSHOMEBREW_CURLRC
Overriding the bundle
teeup sets a variable only if it does not have a value. To use a different file for one tool, set its variable in ~/.config/zsh/local.zsh, which loads after the teeup settings:
export GIT_SSL_CAINFO="$HOME/certs/other.pem"
To remove the bundle entirely, run teeup remove ca-bundle.
Installing teeup on such a network
Before teeup makes its bundle, curl does not trust the company certificate, so the one-line installer cannot download. Do these steps:
-
Make sure that the company root certificate is in the System keychain and is trusted. Usually your IT team installs it. If it is not there, get the certificate file from your IT team, and trust it:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/Downloads/company-root.cerReplace
~/Downloads/company-root.cerwith the path of your certificate file. -
Make a temporary certificate file that has the Apple public roots and the company root certificate. Replace
Company Rootwith the name of the company root certificate, as Keychain Access shows it. Then give the file to curl:security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > "$TMPDIR/teeup-ca.pem" security find-certificate -c "Company Root" -p /Library/Keychains/System.keychain >> "$TMPDIR/teeup-ca.pem" curl --cacert "$TMPDIR/teeup-ca.pem" -fsSL https://teeup.systemhalted.in/install.sh | bashDo not add all of the System keychain to the file. Applications keep certificates there that nobody chose to trust.
If git clone fails with a certificate error, the installer makes a bundle and clones again. The bundle has the certificates that an administrator trusts in the System keychain. Then ./bootstrap makes the teeup bundle, and teeup works on the company network. If no certificate is trusted, the installer stops and shows the add-trusted-cert command from step 1.
You can also run the installer on a different network, for example a phone hotspot.
Troubleshooting
teeup doctor ca-bundle shows if this Mac needs a bundle, and if the bundle is available and current.
If your company replaces its certificate and git fails again, make the bundle again:
teeup configure ca-bundle