This repository was archived by the owner on Jan 16, 2025. It is now read-only.
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
Can not install Homebrew because can not load CA certificate file. #44636
Closed
Description
In terminal when I type in the command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It begins the download of hombrew but it always fails here:
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/homebrew/': SSL: can't load CA certificate file /absolute/path/to/cacert.pem
Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1
I then try to run the install again and it home-brew is installed but it is not. When I try to use any brew command it says command not found. If I try to uninstall home-brew it says homebrew not found
Activity
DomT4 commentedon Oct 5, 2015
That message is being thrown from
curl
, I believe. Are you setting an environmental variable for the CA cert somewhere? Tryenv | grep cacert
.lostatseajoshua commentedon Oct 5, 2015
I am not sure what a environmental variable is. I ran grep cacert and nothing happens and when I run env it just displays a list of information. Sorry I feel clueless on these errors. Do I have to create a CA cert? Where does it come from? I have tired google and not look on this error or what it even is.
DomT4 commentedon Oct 5, 2015
env
prints out a full list of everything loaded into the environment. Includes your$PATH
,$SHELL
, any variable you've exported, etc. You shouldn't be seeing this error at all. The error message suggests that somewhere the default example path for a CA certificate fromcurl
is being passed when it shouldn't be.Make sure you ran the
env | grep cacert
command whole, not both separately.Do you have a
.bashrc
or.zshrc
or.bash_profile
in your$HOME
directory?lostatseajoshua commentedon Oct 5, 2015
Well I think the problem is I don't have a cert to clone from git I always use ssh. Where do I setup a cert to clone from git? I tired to make a .pem file and run git config --system http.sslCAInfo /path/to/file/Certificates.pem but it throws could not lock config file.
apjanke commentedon Oct 9, 2015
You shouldn't need to do any cert-related configuration for this to work. OS X ships with CA certificates already installed, and the system
curl
set up to respect them. (It's not done with PEM files in newer versions; since 10.9,curl
is linked to Apple's Secure Transport framework and gets its CA certs from the system keychain.)This looks like it might be a problem with the git configuration file, and not environment variables. Since Mavericks,
curl
doesn't seem to respect the$CURL_CA_BUNDLE
environment variable. And I can't induce this error on Mavericks at all. But on El Capitan, I can reproduce this issue by adding the following section to~/.gitconfig
.This reproduces the exact error message when running
git
(which I believe is calling out tocurl
orlibcurl
behind the scenes, like DomT4 suggests, and is passing--cacert
or its equivalent).That seems consistent with the OS X curl changes for 10.9 and 10.10.
So, check your
~/.gitconfig
for thatsslCAInfo
line and correct or remove it. Maybe it got edited at some point when you were setting up agit
connection to a different server?DomT4 commentedon Oct 19, 2015
Closing as dead. Will reopen or let another maintainer reopen if we get a reply here.