Update OpenSSL on OS X with Homebrew

前端 未结 8 1464
天命终不由人
天命终不由人 2020-11-22 02:04

I\'m using MacOS X 10.7.5 and I need a newer OpenSSL version due to handshake failures. There are several tutorials on the internet and I tried the following:



        
相关标签:
8条回答
  • 2020-11-22 02:37

    If you're using Homebrew /usr/local/bin should already be at the front of $PATH or at least come before /usr/bin. If you now run brew link --force openssl in your terminal window, open a new one and run which openssl in it. It should now show openssl under /usr/local/bin.

    0 讨论(0)
  • 2020-11-22 02:44
    1. install port: https://guide.macports.org/
    2. install or upgrade openssl package: sudo port install openssl or sudo port upgrade openssl
    3. that's it, run openssl version to see the result.
    0 讨论(0)
  • 2020-11-22 02:49

    I had this issue and found that the installation of the newer openssl did actually work, but my PATH was setup incorrectly for it -- my $PATH had the ports path placed before my brew path so it always found the older version of openssl.

    The fix for me was to put the path to brew (/usr/local/bin) at the front of my $PATH.

    To find out where you're loading openssl from, run which openssl and note the output. It will be the location of the version your system is using when you run openssl. Its going to be somewhere other than the brewpath of "/usr/local/bin". Change your $PATH, close that terminal tab and open a new one, and run which openssl. You should see a different path now, probably under /usr/local/bin. Now run openssl version and you should see the new version you installed "OpenSSL 1.0.1e 11 Feb 2013".

    0 讨论(0)
  • 2020-11-22 02:50

    On mac OS X Yosemite, after installing it with brew it put it into

    /usr/local/opt/openssl/bin/openssl

    But kept getting an error "Linking keg-only openssl means you may end up linking against the insecure" when trying to link it

    So I just linked it by supplying the full path like so

    ln -s /usr/local/opt/openssl/bin/openssl /usr/local/bin/openssl
    

    Now it's showing version OpenSSL 1.0.2o when I do "openssl version -a", I'm assuming it worked

    0 讨论(0)
  • 2020-11-22 02:52

    I had problems installing some Wordpress plugins on my local server running php56 on OSX10.11. They failed connection on the external API over SSL.

    Installing openSSL didn't solved my problem. But then I figured out that CURL also needed to be reinstalled.

    This solved my problem using Homebrew.

    brew rm curl && brew install curl --with-openssl
    
    brew uninstall php56 && brew install php56 --with-homebrew-curl --with-openssl
    
    0 讨论(0)
  • 2020-11-22 02:57

    In a terminal, run:

    export PATH=/usr/local/bin:$PATH
    brew link --force openssl
    

    You may have to unlink openssl first if you get a warning: brew unlink openssl

    This ensures we're linking the correct openssl for this situation. (and doesn't mess with .profile)

    Hat tip to @Olaf's answer and @Felipe's comment. Some people - such as myself - may have some pretty messed up PATH vars.

    0 讨论(0)
提交回复
热议问题