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.

Install on Linux

NOTE: These instructions should work for most Debian based distros.

Install the build dependencies:

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

Clone OpenSSL:

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

Configure it:

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:

make
make test

Install it:

sudo make install

And finally, configure the shared libs:

sudo ldconfig -v

If you run:

openssl version

you should see the following output:

OpenSSL 1.1.1g  21 Apr 2020

Install on macOS

Use brew to install it:

brew install openssl@1.1

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

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

Verify the install:

openssl version

That's it.