Wednesday, March 26, 2014

Leiningen upgrade problem

After working flawlessly for a long time, my local Leiningen script suddenly failed to upgrade Leiningen to the latest version. Instead, it spit out the following error message:

The script at /usr/local/bin/lein will be upgraded to the latest stable version.
Do you want to continue [Y/n]? y

Upgrading...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   137  100   137    0     0    121      0  0:00:01  0:00:01 --:--:--   182
curl: (35) error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
Failed to download https://github.com/technomancy/leiningen/raw/stable/bin/lein
It's possible your HTTP client's certificate store does not have the
correct certificate authority needed. This is often caused by an
out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT
to turn off certificate checks:
  export HTTP_CLIENT="wget --no-check-certificate -O" # or
  export HTTP_CLIENT="curl --insecure -f -L -o"
It's also possible that you're behind a firewall haven't yet
set HTTP_PROXY and HTTPS_PROXY.

The Leiningen script seems to be (incorrectly) guessing at the problem, which had me spinning my wheels for a short time. The solution I found online was to add a '-3' or '--sslv3' flag to the 'curl' command within the lein script. The final modified line (as of the date of this post) is:

        HTTP_CLIENT="curl $CURL_PROXY --sslv3 -f -L -o"

No comments: