Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.76k stars 9.57k forks source link

curl: (51) SSL: certificate verification failed (result: 5) #3246

Closed hackdefendr closed 6 years ago

hackdefendr commented 6 years ago

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

Please always follow these steps:

To help us debug your issue please explain:

MikeMcQuaid commented 6 years ago

[X ] Ran brew config and brew doctor and included their output with your issue?

You didn't do this. I'll reopen it when you have.

hackdefendr commented 6 years ago

Like I said...no brew command is working. But since you don't understand that...here:

`$ brew config ==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5) Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz Error: Failed to install vendor Ruby.`

MikeMcQuaid commented 6 years ago

Please just follow the instructions even if they seem stupid to you as they are there for a reason (i.e please show brew doctor too).

What is the output of ‘env | grep-i ssl’? What version of macOS are you running?

hackdefendr commented 6 years ago

`$ brew doctor ==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz curl: (51) SSL: certificate verification failed (result: 5)

Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz Error: Failed to install vendor Ruby.`

`$ env | grep -i ssl

SSL_CERT_FILE=`

MikeMcQuaid commented 6 years ago

@hackdefendr Try to unset SSL_CERT_FILE and then try again.

What version of macOS are you running?

Still need this information.

hackdefendr commented 6 years ago

Mac OS Sierra 10.12.6

$ brew config ==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5) Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz Error: Failed to install vendor Ruby.

$ brew doctor ==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5) Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz Error: Failed to install vendor Ruby.

$ env | grep -i ssl $

MikeMcQuaid commented 6 years ago

Those are all after unset SSL_CERT_FILE? What does cat ~/.curlrc output?

hackdefendr commented 6 years ago

Yes after I unset SSL_CERT_FILE.

I have no ~/.curlrc file.

MikeMcQuaid commented 6 years ago

What does which curl and curl --version output?

hackdefendr commented 6 years ago

$ which curl /usr/bin/curl

$ curl --version curl 7.54.0 (x86_64-apple-darwin16.0) libcurl/7.54.0 SecureTransport zlib/1.2.8 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

MikeMcQuaid commented 6 years ago

What country are you in? I'm afraid you're going to have widespread problems if you can't access Bintray over HTTPS with curl and this is something specific to your machine.

hackdefendr commented 6 years ago

United States

Is there anyway to tell curl to use --insecure... adding the -k to it?

Where can I put this to test?

EDIT: Never mind that just downloads a 0 byte file

ilovezfs commented 6 years ago

What does

HOMEBREW_ENV_FILTERING=1 brew config

output?

hackdefendr commented 6 years ago

That seems to work...

$ HOMEBREW_ENV_FILTERING=1 brew config ==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz HOMEBREW_VERSION: 1.3.4 ORIGIN: https://github.com/Homebrew/brew HEAD: ac8b58537fe3dd71098a43afcc6a1785dcde1d39 Last commit: 6 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 6fa1d112e878655a1c7d2f8de24e618860499181 Core tap last commit: 28 hours ago HOMEBREW_PREFIX: /usr/local HOMEBREW_REPOSITORY: /usr/local/Homebrew HOMEBREW_CELLAR: /usr/local/Cellar HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com CPU: octa-core 64-bit kabylake Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby Clang: 9.0 build 900 Git: 2.13.5 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Perl: /usr/bin/perl Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby Java: 1.8.0_144 macOS: 10.12.6-x86_64 Xcode: 9.0 CLT: 9.0.0.0.1.1504363082 X11: N/A

ilovezfs commented 6 years ago

:tada:

and now in another shell

brew config
hackdefendr commented 6 years ago

From another shell...

$ brew config HOMEBREW_VERSION: 1.3.4 ORIGIN: https://github.com/Homebrew/brew HEAD: ac8b58537fe3dd71098a43afcc6a1785dcde1d39 Last commit: 6 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 2105c573bd1cb60a0c5e46bee8f2a9f6537455c6 Core tap last commit: 2 hours ago HOMEBREW_PREFIX: /usr/local HOMEBREW_REPOSITORY: /usr/local/Homebrew HOMEBREW_CELLAR: /usr/local/Cellar HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com CPU: octa-core 64-bit kabylake Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby Clang: 9.0 build 900 Git: 2.13.5 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Perl: /usr/bin/perl Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /Users/jsingleton/.rvm/rubies/ruby-2.2.5/bin/ruby Java: 1.8.0_144 macOS: 10.12.6-x86_64 Xcode: 9.0 CLT: 9.0.0.0.1.1504363082 X11: N/A

ilovezfs commented 6 years ago

Looks like you're back in business with the mystery … unsolved.

hackdefendr commented 6 years ago

I agree...and some mysteries are best left unsolved.

Thank-you!

ilovezfs commented 6 years ago

you're welcome!

MikeMcQuaid commented 6 years ago

@hackdefendr Would still love to figure out what this is. What about env | grep -i curl?

hackdefendr commented 6 years ago

Oops I forgot I had this one set. Did that as part of troubleshooting.

$ env | grep -i curl CURL_CA_BUNDLE=/Users/jsingleton/.ssh/cacert.pem $

I unset this already and tried again. Everything still working.

$ unset CURL_CA_BUNDLE $ brew doctor Warning: Calling fails_with :llvm is deprecated! There is no replacement. /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/john-jumbo.rb:23:in `' Please report this to the sidaf/pentest tap!

Warning: Calling fails_with :llvm is deprecated! There is no replacement. /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/john-jumbo.rb:23:in `' Please report this to the sidaf/pentest tap!

Warning: Calling fails_with :llvm is deprecated! There is no replacement. /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/john-jumbo.rb:23:in `' Please report this to the sidaf/pentest tap!

Warning: Calling fails_with :llvm is deprecated! There is no replacement. /usr/local/Homebrew/Library/Taps/sidaf/homebrew-pentest/john-jumbo.rb:23:in `' Please report this to the sidaf/pentest tap!

Your system is ready to brew.

suratpyari commented 6 years ago

I am having same issue while installing ruby. Please check my console output

$ rvm install 2.4
Warning, new version of rvm available '1.29.3', you are using older version '1.27.0'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Unknown ruby string (do not know how to handle): ruby-2.4.
Unknown ruby string (do not know how to handle): ruby-2.4.
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.4',
showing last 15 lines of /Users/apple/.rvm/log/1511411211_ruby-2.4/update_system.log
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
$ brew update
Already up-to-date.
$ env | grep -i curl
$ cat ~/.curlrc
cacert=/etc/ssl/certs/ca-certificates.crt
$ which curl
/opt/local/bin/curl
$ curl --version
curl 7.50.3 (x86_64-apple-darwin14.5.0) libcurl/7.50.3 OpenSSL/1.0.2j zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 
$ brew config
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.
$ brew doctor
==> Downloading https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz

curl: (51) SSL: certificate verification failed (result: 5)
Error: Download failed: https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Error: Failed to install vendor Ruby.

My OS version is 10.10

MikeMcQuaid commented 6 years ago

@suratpyari Delete your ~/.curlrc