zkat’s diary

技術ブログ

UbuntuでOpenSSL1.1.1をソースからビルドしてローカルインストール

概要

タイトルの通り、OpenSSL1.1.1をUbuntuでビルドしてローカルにインスールしたときにやったことメモです

依存ライブラリのインストール

以下の通りPerlのいくつかのモジュールに依存してるらしいので、 インストールします。

$ sudo apt-get install libtext-template-perl libtest-most-perl
 We make increasing use of Perl modules, and do our best to limit
 ourselves to core Perl modules to keep the requirements down.  There
 are just a few exceptions:

 Test::More         We require the minimum version to be 0.96, which
                    appeared in Perl 5.13.4, because that version was
                    the first to have all the features we're using.
                    This module is required for testing only!  If you
                    don't plan on running the tests, you don't need to
                    bother with this one.

 Text::Template     This module is not part of the core Perl modules.
                    As a matter of fact, the core Perl modules do not
                    include any templating module to date.
                    This module is absolutely needed, configuration
                    depends on it.

コンフィグ

以下の通りconfigスクリプトを実行します。 prefixとopenssldirは同じところを記載するのがよいらいしいです。

$ ./config --prefix=/path/to/dir --openssldir=/path/to/dir
The rule of thumb to use when you want something that "just works" for all recent versions of OpenSSL, including OpenSSL 1.0.2 and 1.1.0, is:
specify both --prefix and --openssldir
set --prefix and --openssldir to the same location

wiki.openssl.org

共有ライブラリのパス

libssl.so.1.1がないと言われたりするので、LD_LIBRARY_PATHにインストール先のlibディレトリを追加します。

$ openssl version
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
$ export LD_LIBRARY_PATH="/path/to/dir/lib/:$LD_LIBRARY_PATH"
$ openssl version
OpenSSL 1.1.1d  10 Sep 2019