0
2

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.

Windows で OpenSSL を ビルドする

Last updated at Posted at 2022-05-31

Windows で OpenSSL をビルドする

Windows版のビルド方法は、以下に記載されていました。

上記の情報を元にビルドしてみました。

必要なアプリケーション

  • OpenSSL 3.0.x
  • Visual Studio 2022 Community
  • Strawberry Perl for Windows
  • NASM (アセンブラも使ってビルドすときに必要)

アプリケーションのインストール

OpenSSL の ソースコードを以下からダウンロードします。

Visual Stuido 2022 Commnunity を以下からダウンロードとしてインストールします。

Strawberry Perl を以下からダウンロードしてインストールします。

アセンブラも使用してビルドする場合、NASMが必要です。

最新版の2.15.05 では、何故かビルド時にエラーが出て、OpenSSLのビルドに失敗したので、2.14.02を使います。

64bit版のOpenSSLを作成する場合、以下の64bit版 NASM をダウンロードし、インストールします。

https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win64/

32bit版のOpenSSLを作成する場合、以下の32bit版 NASM をダウンロードし、インストールします。

https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win32/

OpenSSLのビルド

Visual Studio用 コマンドプロンプトを 起動

64bit版のOpenSSLを作成する場合、x64 Native Tools Command Prompt for VS 2022 を管理者権限で実行します。32bit版のOpenSSLを作成する場合、x86 Native Tools Command Prompt for VS 2022 を管理者権限で実行します。

圧縮ファイルの展開

OpenSSLの圧縮ファイルを展開します。

>tar xvf openssl-3.0.2.tar.gz

cd

ビルド

64bit版 アセンブラを使用しないでコンパイル

> cd openssl-3.0.10
> perl Configure VC-WIN64A no-asm
> nmake
> nmake test
> nmake install

64bit版 アセンブラを使用してコンパイル

NASM.EXEのフォルダを環境変数 PATH に設定してからコンパイルを実施します。

> cd openssl-3.0.10
> set PATH=%PATH%;C:\Program Files\NASM
> perl Configure VC-WIN64A
> nmake
> nmake test
> nmake install

32bit版 アセンブラを使用しないでコンパイル

> cd openssl-3.0.2
> perl Configure VC-WIN32 no-asm
> nmake
> nmake test
> nmake install

32bit版 アセンブラを使用してコンパイル

NASM.EXEのフォルダを環境変数 PATH に設定してからコンパイルを実施します。

> cd openssl-3.0.2
> set PATH=%PATH%;C:\Program Files (x86)\NASM
> perl Configure VC-WIN32
> nmake
> nmake test
> nmake install

完成

作成されたOpenSSLは、64bit版は、以下に格納されます。

C:\Program Files\OpenSSL

32bit版は、以下に格納されます。

C:\Program Files (x86)\OpenSSL

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?