0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OpenSSL のビルド

Posted at

OpenSSL を使ったプログラムをデバッグしたくなった時に読むメモ。大体は以下を参照すれば OK。

OpenSSL Cookbook 3rd Edition - 1.1.2  Building OpenSSL

例えば OpenSSL 1.1.1 を試したいときは次のようにする。no-shared がポイントらしい。

git clone https://github.com/openssl/openssl.git
cd openssl
git checkout OpenSSL_1_1_1 -b OpenSSL_1_1_1
./config --prefix=$HOME/local no-shared --debug
make

この時点で apps/openssl コマンドが出来ているので、特定のバージョンの CLI を試したいだけならこれだけで良い。他のプログラムで使いたい場合は make install で --prefix で指定した場所にインストールする。

make install

例えば CMakeLists.txt で使いたい場合はインストールした位置を指定する。

include_directories(~/local/include)
link_directories(~/local/lib)

私の場合なぜかローカルの openssl をリンクする時だけ dl と pthread を追加で指定する必要があった。ビルドの仕方が間違ってるのかな?

add_executable(hoge hoge.cpp)
target_link_libraries(hoge crypto dl pthread)

これで openssl の中までデバッグできて気持ちいい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?