Brew search --> Error: SSL_connect returned=1 errno=0 state=error

Hey All,

I have an issue in my corporate environment.

Jeffery

11:07 $ brew search completion
Error: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain)
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/net/protocol.rb:44:in `connect_nonblock'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/net/protocol.rb:44:in `ssl_socket_connect'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/net/http.rb:996:in `connect'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/net/http.rb:919:in `start'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:337:in `open_http'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:756:in `buffer_open'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:226:in `block in open_loop'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:224:in `catch'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:224:in `open_loop'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:165:in `open_uri'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:736:in `open'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/open-uri.rb:744:in `read'
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions/Casks/microsoft-edge-canary.rb:6:in `file_version'
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions/Casks/microsoft-edge-canary.rb:16:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:48:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:48:in `config='
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:39:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:35:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:35:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:75:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:121:in `cask'
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions/Casks/microsoft-edge-canary.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:62:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:62:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:22:in `block in each'
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:21:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cask.rb:21:in `each'
/usr/local/Homebrew/Library/Homebrew/searchable.rb:29:in `select'
/usr/local/Homebrew/Library/Homebrew/searchable.rb:29:in `search_string'
/usr/local/Homebrew/Library/Homebrew/searchable.rb:9:in `search'
/usr/local/Homebrew/Library/Homebrew/extend/os/mac/search.rb:31:in `search_casks'
/usr/local/Homebrew/Library/Homebrew/cmd/search.rb:88:in `search'
/usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
11:07 $ brew update
Already up-to-date.
11:08 $ brew doctor
Your system is ready to brew.
11:08 $ brew config
HOMEBREW_VERSION: 2.1.16
ORIGIN: https://github.com/Homebrew/brew
HEAD: 3aa7624284c43180a3f3a71aeaa9263092868e12
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a25b95559c376671a0379610ae18e8578c534799
Core tap last commit: 62 minutes ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_202
macOS: 10.14.6-x86_64
CLT: 11.0.0.0.1.1567737322
Xcode: 11.1
CLT headers: 11.0.0.0.1.1567737322
1 Like

Have you tried getting rid of the mitm attack that’s being performed?

The man in the middle attack is my corporate network. I would get fired.

It sucks, but it’s a constraint I have to live with. :unamused:

That doesn’t really leave any options. Maybe you could get ruby to trust the certificate but there isn’t really anything brew can do for you in this case.

This is exactly what I’m looking for.

I’ve updated the Root CAs for OpenSSL, but that has no effect on the portable ruby used by Homebrew.

I’d encourage you to check out the manpage section “Using Homebrew behind a proxy” which has some environment variables that might be useful for using Homebrew behind certain restricted networks. Setting HOMEBREW_CURLRC might also be useful.