How to install OpenSSL 1.1.1?

OpenSSL is a TLS/SSL and crypto library.

Most Linux distributions come packaged with some older version of OpenSSL, but if you need some of newest features (such as support for TLSv1.3), then you’ll need to manually install it.

These instructions should work for most Debian based distros.

Install the build dependencies:

1
sudo apt-get -y install build-essential checkinstall git zlib1g-dev

Clone OpenSSL:

1
git clone --depth 1 --branch OpenSSL_1_1_1g https://github.com/openssl/openssl.git

Configure it:

1
2
cd openssl
./config zlib '-Wl,-rpath,$(LIBRPATH)'
Note
The rpath flag is used to set the runtime shared library search path, check the notes about shared libs and non-default install locations.

Build and test:

1
2
make
make test

Install it:

1
sudo make install

And finally, configure the shared libs:

1
sudo ldconfig -v

If you run:

1
openssl version

you should see the following output:

1
OpenSSL 1.1.1g  21 Apr 2020

Use brew to install it:

1
brew install openssl@1.1

You might also need to add the binary to the PATH:

1
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile

Verify the install:

1
openssl version

That’s it.