1

Issue:

NOTE: my PC is the following: macOS Catalina v.10.15.6

When I try to run brew install serverless --debug, I receive the following error:

/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/serverless.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.9.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gdbm.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://homebrew.bintray.com/bottles/serverless-2.8.0.catalina.bottle.tar.gz
==> Downloading https://homebrew.bintray.com/bottles/serverless-2.8.0.catalina.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --range 0-1 --dump-header - --write-out \%\{http_code\} --output /dev/null https://homebrew.bintray.com/bottles/serverless-2.8.0.catalina.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --fail --progress-bar --retry 3 --location --remote-time --continue-at 0 --output /Users/nathan.benton/Library/Caches/Homebrew/downloads/231206e0f0b3df991dae7516f5477c084a8d6cfa35a2dbf2db91832450227d96--serverless-2.8.0.catalina.bottle.tar.gz.incomplete https://homebrew.bintray.com/bottles/serverless-2.8.0.catalina.bottle.tar.gz

curl: (77) error setting certificate verify locations:
  CAfile: /etc/ssl/cert.pem
  CApath: none
Error: Failed to download resource "serverless"
Download failed: https://homebrew.bintray.com/bottles/serverless-2.8.0.catalina.bottle.tar.gz
Warning: Bottle installation failed: building from source.
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://github.com/serverless/serverless/archive/v2.8.0.tar.gz
==> Downloading https://github.com/serverless/serverless/archive/v2.8.0.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --range 0-1 --dump-header - --write-out \%\{http_code\} --output /dev/null https://github.com/serverless/serverless/archive/v2.8.0.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.5.6-82-g6d8978e\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.6\)\ curl/7.64.1 --header Accept-Language:\ en --fail --progress-bar --retry 3 --location --remote-time --continue-at 0 --output /Users/nathan.benton/Library/Caches/Homebrew/downloads/f8c8a2c6906ba5d5e0a0e03c64459a72cdf60c98cf792ce14b95d1df1a42e98b--v2.8.0.tar.gz.incomplete https://github.com/serverless/serverless/archive/v2.8.0.tar.gz

curl: (77) error setting certificate verify locations:
  CAfile: /etc/ssl/cert.pem
  CApath: none
Error: Failed to download resource "serverless"
Download failed: https://github.com/serverless/serverless/archive/v2.8.0.tar.gz
/usr/local/Homebrew/Library/Homebrew/download_strategy.rb:372:in `rescue in fetch'
/usr/local/Homebrew/Library/Homebrew/download_strategy.rb:369:in `fetch'
/usr/local/Homebrew/Library/Homebrew/resource.rb:137:in `fetch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `fetch'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1809:in `fetch'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:1046:in `fetch'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:367:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:287:in `block in install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:285:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:285:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:120:in `<main>'

This is very odd as my tests show (e.g. curl https://www.wikipedia.com -v) with a simple cURL that this tool works (even with HTTPS):

curl https://www.wikipedia.com -v                                                    INT ✘  at 09:22:46 AM  
*   Trying 2620:0:863:ed1a::3:443...
* Connected to www.wikipedia.com (2620:0:863:ed1a::3) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /usr/local/etc/openssl/cert.pem
*  CApath: /usr/local/etc/openssl/
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=wikipedia.com
*  start date: Sep 23 08:01:18 2020 GMT
*  expire date: Dec 22 08:01:18 2020 GMT
*  subjectAltName: host "www.wikipedia.com" matched cert's "*.wikipedia.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fb69d012e00)
> GET / HTTP/2
> Host: www.wikipedia.com
> user-agent: curl/7.73.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 301
< server: nginx/1.14.2
< date: Thu, 22 Oct 2020 14:22:58 GMT
< content-type: text/html
< content-length: 185
< location: https://www.wikipedia.org/
< strict-transport-security: max-age=106384710; includeSubDomains; preload
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.14.2</center>
</body>
</html>
* Connection #0 to host www.wikipedia.com left intact

Note the following about 1) cURL version and 2) my PATH environment variable:

1.

/usr/bin/curl
PATH=PATH=/Applications/SnowSQL.app/Contents/MacOS:/Users/nathan.benton/bin:/usr/local/bin:/usr/local/bin:/usr/local/opt:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin

Finally, the following output is from brew config:

HOMEBREW_VERSION: 2.5.6-82-g6d8978e
ORIGIN: https://github.com/Homebrew/brew
HEAD: 6d8978e0beedf0dbec0f143cfeb06445338838f3
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 54c7233eefc7048a7bd8bb6a7526ae65e7ecb877
Core tap last commit: 3 days ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 11.0.8
macOS: 10.15.6-x86_64
CLT: 12.0.0.0.1.1599194153
Xcode: N/A

QUESTION: As you can see, when brew issues requests to download via cURL, it does NOT use the certification info that is used by default when I use it ad-hoc without brew. What's causing this and what's a possible solution?

FINAL NOTE - in case this is useful (via brew doctor):

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /usr/local/opt/pkg-config

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  kubernetes-cli
nate
  • 440
  • 2
  • 8
  • 18
  • 1
    Does this answer your question? [brew install fails: curl(77) error setting certificate verify](https://stackoverflow.com/questions/45829588/brew-install-fails-curl77-error-setting-certificate-verify) – 0stone0 Oct 22 '20 at 14:42
  • @0stone0 yes, I already gave that a shot but the issue persisted - additionally the command `sed -i '/^insecure$/d' ~/.curlrc` throws an error... – nate Oct 22 '20 at 15:18
  • 1
    exact text of the error message please, or does using `sed -i "" ...` solve that error? Good luck – shellter Oct 22 '20 at 15:33

0 Answers0