LoginSignup
0
0

More than 5 years have passed since last update.

iDempiere4.1(JPiere4.1)のSSL対応

Last updated at Posted at 2018-11-28

1.秘密鍵の生成

# openssl genrsa -aes128 -out idempiere.key 2048

パスフレーズを入力を求められるので、入れる(確認もあるので2回)

Generating RSA private key, 2048 bit long modulus
.........................+++
...............+++
e is 65537 (0x10001)
Enter pass phrase for idempiere.key:パスフレーズを入力する
Verifying - Enter pass phrase for idempiere.key:パスフレーズを入力する

SAN対応

openssl.cnf を作業用ディレクトリにコピーして、subjectAltName にサイトURLを指定します。

*Ubuntuだと/etc/ssl/openssl.cnf
*CentOSだと/etc/pki/tls/openssl.cnf 


# cp /etc/ssl/openssl.cnf openssl4idempiere.cnf
# vi openssl4idempiere.cnf

[ SAN ]
subjectAltName = @alt_names

[ alt_names ]
DNS.1 = abc.japanwest.cloudapp.azure.com
DNS.2 = def.japanwest.cloudapp.azure.com

CSRの作成

openssl req -new -key idempiere.key -sha256 -subj "/C=JP/ST=Tokyo/L=xxxx/O=xxxx/CN=abc.japanwest.cloudapp.azure.com" -out idempiere.csr

Enter pass phrase for idempiere.key:秘密鍵のパスフレーズを入力する

req CSRファイルを作成
-new 新規にCSRを作成する
-key 秘密鍵ファイルを指定する
-sha256 署名ハッシュアルゴリズムとして SHA-2 を使用する。
-subj Subjectを指定 C=国名 ST=都道府県名 L=市町村名 O=組織名 CN=サイトのURL

証明書(公開鍵)の作成

openssl x509 -req -days 3650 -sha256 -in idempiere.csr -signkey idempiere.key -extfile openssl4idempiere.cnf -extensions SAN -out idempiere.crt

Enter pass phrase for idempiere.key:秘密鍵のパスフレーズを入力する

keystoreの作成

Jettyでは、PKCS12フォーマットでないと使えないので、サーバの秘密鍵ファイル、サーバ証明書からPKCS12形式のファイルを作成します。

$ openssl pkcs12 -inkey idempiere.key -in idempiere.crt -export -out idempiere.pkcs12

Enter pass phrase for idempiere.key:秘密鍵のパスフレーズを入力する
Enter Export Password:エクスポートのパスワードを入力する
Verifying - Enter Export Password:エクスポートのパスワードを入力する

PKCS12形式のファイルをkeystoreに変換します

keytool -importkeystore -srckeystore idempiere.pkcs12 -srcstoretype PKCS12 -destkeystore keystore

$ keytool -importkeystore -srckeystore idempiere.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
キーストアidempiere.pkcs12をkeystoreにインポートしています...
出力先キーストアのパスワードを入力してください:キーストアのパスワードを入力する
新規パスワードを再入力してください:キーストアのパスワードを入力する
ソース・キーストアのパスワードを入力してください:エクスポートのパスワードを入力する

別名1のエントリのインポートに成功しました。

最後にkeystoreをjettyのetc以下に設置します。

mv keystore idempiere_home/jettyhome/etc/

mv keystore /opt/idempiere-server/jettyhome/etc/

参考サイト

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