Skip to content
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
@lostatseajoshua

Description

@lostatseajoshua

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

DomT4 commented on Oct 5, 2015

@DomT4
Contributor

SSL: can't load CA certificate file /absolute/path/to/cacert.pem

That message is being thrown from curl, I believe. Are you setting an environmental variable for the CA cert somewhere? Try env | grep cacert.

lostatseajoshua

lostatseajoshua commented on Oct 5, 2015

@lostatseajoshua
Author

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

DomT4 commented on Oct 5, 2015

@DomT4
Contributor

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 from curl 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

lostatseajoshua commented on Oct 5, 2015

@lostatseajoshua
Author

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

apjanke commented on Oct 9, 2015

@apjanke
Contributor

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.

[http]
        sslVerify = true
        sslCAinfo = /absolute/path/to/cacert.pem

This reproduces the exact error message when running git (which I believe is calling out to curl or libcurl behind the scenes, like DomT4 suggests, and is passing --cacert or its equivalent).

$ git clone https://github.com/homebrew/homebrew.git
Cloning into 'homebrew'...
fatal: unable to access 'https://github.com/homebrew/homebrew.git/': SSL: can't load CA certificate file /absolute/path/to/cacert.pem

That seems consistent with the OS X curl changes for 10.9 and 10.10.

So, check your ~/.gitconfig for that sslCAInfo line and correct or remove it. Maybe it got edited at some point when you were setting up a git connection to a different server?

DomT4

DomT4 commented on Oct 19, 2015

@DomT4
Contributor

Closing as dead. Will reopen or let another maintainer reopen if we get a reply here.

locked and limited conversation to collaborators on Jul 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @apjanke@DomT4@lostatseajoshua

        Issue actions

          Can not install Homebrew because can not load CA certificate file. · Issue #44636 · Homebrew/legacy-homebrew