For those who came here looking for the actual brew commands:
brew install curl --with-nghttp2 --with-openssl
brew link curl --force
You can also use --with-libressl instead of --with-openssl if you prefer LibreSSL.