Yosemite supplied curl stopped supporting https

command linehomebrew

I am having the issue that curl is failing to deal with https, and thus I cannot update Homebrew:

brew update && brew upgrade
fatal: unable to access 'https://github.com/Homebrew/homebrew/': Protocol https not supported or disabled in libcurl
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

This is incomprehensible to be, because it has just started happening today. When I run

which curl
/usr/bin/curl

Then:

/usr/bin/curl --version
curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.21.6
Protocols: dict file ftp gopher http imap pop3 smtp telnet tftp
Features: IPv6 Largefile

The HTTPS protocol is clearly missing but I cannot fathom why. This is really puzzling — what has happened (yesterday I could run brew update && brew upgrade without any errors.

I am on OS X 10.10.2, with the latest XCode and CL tools, and so on and so forth. To the best of my knowledge I have never touched curl or installed something that might have (and the fact that the standard curl is the os supplied version makes things even more strange).

Best Answer

I realised what had happened. I am trying to run BAPS, which requires the Matlab Runtime Compiler, though it is provided with BAPS and an ancillary installation. Once you install the whole lot you need to let BAPS know where the MRC dynamic libraries are, and the 'recommended' method is to set $DYLD_LIBRARY_PATH to:

export DYLD_LIBRARY_PATH='/Applications/MATLAB/MATLAB_Compiler_Runtime/v84/runtime/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v84/sys/os/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v84/bin/maci64'

That put the wrong libcurl in the way and hosed the system. So, lesson learned: figure out how to set the DYLD_LIBRARY_PATH in a smarter way.