Sunday, February 15, 2015

Git clone via https fails with "Error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)" on MacOSX

TLDR;
1. Install homebrew, if not already
2. Update brew if it already exists
    $brew update
3. Install latest version of OpenSSL via brew
    $brew upgrade openssl
4. Install latest version of cURL via brew
    $brew upgrade curl
5. Uninstall git if already present and re-install with options as below
    $brew install git --with-brewed-curl --with-brewed-openssl

Issue Resolved!

In Detail:
Am on Mountain Lion(Yosemite is out, but am holding the old fort here). On trying to clone with git via https, this issue occurs when the OpenSSL version of the server and client is not compatible.
Updating OpenSSL should sort this out. OSX comes shipped with cURL and OpenSSL. They have moved to SecureTransport so their OpenSSL is out of date. When git is installed initially it picks up the shipped(abet older) versions of cURL and OpenSSL. So, uninstall git and reinstall it with options, that explicitly choose brewed(latest installed via homebrew) versions of those two.