Skip to content

Instantly share code, notes, and snippets.

@yaleman
Last active September 13, 2018 01:11
Show Gist options
  • Save yaleman/64d1bff42303d9836137437c3a3a10f7 to your computer and use it in GitHub Desktop.
Save yaleman/64d1bff42303d9836137437c3a3a10f7 to your computer and use it in GitHub Desktop.
OpenSSL build script
#!/bin/bash
URL="https://www.openssl.org/source/openssl-1.1.1.tar.gz"
BUILDDIR=$(mktemp -d)
echo "Downloading OpenSSL Package..."
wget -O "$BUILDDIR/openssl.tar.gz" $URL
cd $BUILDDIR
echo "Extracting package..."
tar zxf openssl.tar.gz
cd $(find . -maxdepth 1 -type d | egrep -v "^\.$")
echo "Doing configure"
./Configure enable-ssl2 enable-ssl3 enable-ssl3-method zlib linux-x86_64 PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/"
echo "Making"
make
echo "Installing, need sudo..."
sudo make install || exit
echo "Done, removing $TEMPDIR"
rm -rf "$TEMPDIR"
echo "Updating ldconfig"
sudo ldconfig
echo Version info:
openssl version
if [ ! -f /usr/local/ssl/cert.pem ]; then
echo "CA store missing, creating link"
sudo ln -s /etc/ssl/certs/ca-certificates.crt /usr/local/ssl/cert.pem
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment