10

How do I install OpenSSL 1.0.2 version in Debian (Raspberry Pi3) OS. It just installs OpenSSL 1.0.1 automatically. I require version later than this i.e. 1.0.2* which supports DTLS.

Please help how to install latest version

Jyoti Raj Sharma
  • 141
  • 1
  • 2
  • 7

2 Answers2

6

If you really need it but can't obtain it from the repos, you could always try compiling from source. Install git and build-essentials (if you don't have it already) and run the following:

git clone git://git.openssl.org/openssl.git --depth 1
cd openssl
./config
make
make test
sudo make install

NOTE: On some distros (e.g. Ubuntu 19.10), you may need to run the config step as ./config --prefix=/usr. This puts the compiled binaries in /usr/bin, not /usr/local/bin.

Itachi
  • 103
  • 3
trillian
  • 420
  • 3
  • 12
1

Debian jessie-backports would contain the required openssl with version 1.0.2. However you should not directly install the package from jessie-backports since it was compiled for ARMv7-A while Raspbian is compiled for ARMv6. Luckily, you can get the source from jessie-backports and build packages with the proper compiler options for Raspbian.

Using the cross compilation toolchain described here you can proceed as follows:

Add jessie-backports sources to your apt sources list:

echo "deb-src http://httpredir.debian.org/debian jessie-backports main contrib non-free" | sudo tee /etc/apt/sources.list.d/jessie-backports.list
sudo apt update

Get the openssl source code from jessie-backports:

apt-get source openssl/jessie-backports

Build the openssl Debian packages:

cd openssl-1.0.2k/
export DEB_BUILD_OPTIONS=nocheck; debuild -us -uc -aarmhf

Copy the resulting packages to your Raspberry Pi:

scp libssl1.0.0_1.0.2k-1~bpo8+1_armhf.deb  pi@raspberrypi:
scp openssl_1.0.2k-1~bpo8+1_armhf.deb pi@raspberrypi:

Enter the Raspberry Pi and install the new packages:

ssh pi@raspberrypi
sudo dpkg -i libssl1.0.0_1.0.2k-1~bpo8+1_armhf.deb
sudo dpkg -i openssl_1.0.2k-1~bpo8+1_armhf.deb

Notes:

  • Do not forget to recompile your openssl packages as soon as there are security updates!
  • Installing Debian packages is a lot cleaner than doing a make install.
  • If you do not want to install a cross compilation toolchain, you can also do the above steps directly on a Raspberry Pi. On the Pi 3 Model B the compilation takes about 35 minutes.