fatal: unable to access ... linuxbrew.git: error setting certificate verify locations ...
brew update is failing:
>brew update
fatal: unable to access 'https://github.com/Homebrew/linuxbrew.git/': error setting certificate verify locations:
CAfile: /home/<me>/.linuxbrew/etc/openssl/cert.pem
CApath: none
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
But ~/.linuxbrew/etc/openssl/cert.pem definitely exists.
Is this related to issue #158?
Can you report the output of brew postinstall openssl and brew test openssl?
@sjackman - here you go!
~$ brew postinstall openssl
==> Downloading http://curl.haxx.se/ca/cacert.pem
################################################################################################################################################################## 100.0%
~$ brew test openssl
Testing openssl
==> /home/me/.linuxbrew/Cellar/openssl/1.0.1j/bin/openssl dgst -sha1 -out checksum.txt testfile.txt
~$ brew update
fatal: unable to access 'https://github.com/Homebrew/linuxbrew.git/': error setting certificate verify locations:
CAfile: /home/me/.linuxbrew/etc/openssl/cert.pem
CApath: none
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Thanks /DA
Perhaps it's a permissions issue? It seems unlikely, but it's worth checking.
ls -ld /home/me/.linuxbrew/etc/openssl/cert.pem
ls -ld /home/me/.linuxbrew/etc/openssl/
ls -ld /home/me/.linuxbrew/etc/
ls -ld /home/me/.linuxbrew/
ls -ld /home/me/
ls -ld /home/
ls -ld /
Also a shot in the dark, but you can try…
brew install git --with-brewed-openssl --with-brewed-curl
@sjackman - thanks for your response. I have checked each of the files/directories, and I have rw permission for first 5 and execute permission for all but the first.
Also, I tried your shot in the dark, but no luck. I get the same result when I try "brew update".
Can you try wc /home/me/.linuxbrew/etc/openssl/cert.pem.
$ wc /home/sjackman/.linuxbrew/etc/openssl/cert.pem
3894 4653 251894 /home/sjackman/.linuxbrew/etc/openssl/cert.pem
Wow. Nothing there! (Empty file.)
How do I fix that?
Try…
rm -f /home/me/.linuxbrew/etc/openssl/cert.pem
wc /home/me/.linuxbrew/etc/openssl/cert.pem
brew postinstall openssl
wc /home/me/.linuxbrew/etc/openssl/cert.pem
If I understood anything at all about how this all work, I know I could have figured that out! (Feeling a bit stupid now.)
Thank, man.
No worries. Glad we sorted it out.
I solved this with ln -s /etc/pki/tls/cert.pem /home/myusername/.linuxbrew/etc/openssl/cert.pem.
Thanks for the workaround. Did brew postinstall openssl work for you?
Thanks for the workaround. Did
brew postinstall opensslwork for you?
@sjackman it's been a week, and I don't recall clearly, but I don't think it did.
I was running into this same issue while trying to install bcftools. (BCFtools has openSSL as a prerequisite). It seems to be a bootstrapping/catch22 problem: curl can't download the cert.pem because it's an https:// and it doesn't have a cert.pem to confirm that the connection is secure. The ln -s /etc/pki/tls/cert.pem $HOME/.linuxbrew/etc/openssl/cert.pemas proposed by @kris-luminar above worked for me as well.
I just ran into this as well. I manually downloaded the cert.pem it was trying to pull and dropped it into $HOME/.linuxbrew/etc/openssl/cert.pem. However, if I tried to run postinstall again it would wipe out this file and then choke on the lack of a rootca file again.
I've created PR https://github.com/Linuxbrew/homebrew-core/pull/2924 to resolve this issue by adding an http mirror for the OpenSSL certificates cacert.pem.
Fixed by https://github.com/Linuxbrew/homebrew-core/pull/2924
brew postinstall openssl did trick for me and fixed the similar issue. Thank you very much!!!