7

The new LTS 1.1.1 version of OpenSSL is out.

How can I upgrade to it using homebrew on MacOS?

nyedidikeke
  • 6,899
  • 7
  • 44
  • 59
user1222324562
  • 965
  • 2
  • 9
  • 24

3 Answers3

22

Using brew:

brew update
brew install openssl@1.1
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
# Verify 
openssl version
# OpenSSL 1.1.1c  28 May 2019
user82395214
  • 829
  • 14
  • 37
user1222324562
  • 965
  • 2
  • 9
  • 24
2

https://stackoverflow.com/a/56639316 is a good canonical answer, but if you're looking for something simpler / one-off you may be able to get by with just this:

$ brew install openssl@1.1
$ /usr/local/opt/openssl/bin/openssl version
OpenSSL 1.1.1g  21 Apr 2020

So you could do something like this for example:

$ /usr/local/opt/openssl/bin/openssl rand -hex 32
a37d26158b53c8b43faa26ce8291fec9

If you don't have brew on your computer you can install it in one-line by following the instructions here:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Michael
  • 31
  • 2
  • if you can't find openssl in the location above, run `brew info openssl`, it will tell you, like `/opt/homebrew/opt/openssl@1.1/bin/openssl` – Wayne Mao Apr 04 '23 at 08:23
1

Same thing as the accepted answer but please do a source ~/.bash_profile for this to work.

  • Please note that the "accepted" tick can change any time because the author of the question can always move it. So please identify the answer you are extending by other means. I propose using the authors name. Also, please explain in which cases that answer fails. (I am no expert here, but I seem to remember that the profile is auto-applied with opening a shell.) – Yunnosch Jul 21 '21 at 06:58