### WARNING: THIS IS ONLY FOR TESTING AND NOT FOR PRODUCTION USE ###
### WARNING: THIS CAN BREAK YOUR UBUNTU INSTALLATION ###
#root
sudo su -
#download
cd /tmp
wget https://www.openssl.org/source/openssl-3.0.0-alpha2.tar.gz
tar -xvf openssl-3.0.0-alpha2.tar.gz
cd openssl-3.0.0-alpha2/
#NOTE: The OpenSSL 3.0 alpha release contains an error introduced during the release process which results in a failed compilation. Please edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line
sed -i 's/"//g' VERSION
#build and install
./config
make
make install
#configure library path
echo /usr/local/lib >/etc/ld.so.conf.d/openssl.conf
#check it
ldconfig -v
#output should be:
#/usr/local/lib:
# libssl.so.3 -> libssl.so.3
# libcrypto.so.3 -> libcrypto.so.3
#backup and disable previous version
mv /usr/bin/c_rehash /usr/bin/c_rehash.old
mv /usr/bin/openssl /usr/bin/openssl.old
#check results
which openssl
#output should be:
#/usr/local/bin/openssl
openssl version -a
#output should be:
#OpenSSL 3.0.0-alpha2 15 May 2020 (Library: OpenSSL 3.0.0-alpha2 15 May 2020)
#built on: ...
#platform: linux-aarch64
#options: bn(64,64)
#compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DNDEBUG
#OPENSSLDIR: "/usr/local/ssl"
#ENGINESDIR: "/usr/local/lib/engines-3"
#MODULESDIR: "/usr/local/lib/ossl-modules"
#Seeding source: os-specific
#CPUINFO: OPENSSL_armcap=0x3
### Based on https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/