Apache2でのSSL経由の接続環境の設定は長くなりそうなので、別に分けます。
主に/opt/local/etc/apache2/extra/httpd-ssl.confの修正内容となると思います。
実働用のserver.keyとかの証明書関連は、何処に仕舞ったかから……次にそれが正しいかの確認もしました。
探すの大変……(涙)
先ずは現時点で修正した内容
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
26c26 < #SSLRandomSeed startup file:/dev/random 512 --- > SSLRandomSeed startup file:/dev/random 512 125,126c125,126 < ServerName www.example.com:443 < ServerAdmin you@example.com --- > ServerName www2.lo.k-in.co.jp:443 > ServerAdmin dupport@k-in.co.jp 144c144 < SSLCertificateFile "/opt/local/etc/apache2/server.crt" --- > SSLCertificateFile "/opt/local/etc/apache2/conf/server.crt" 154c154 < SSLCertificateKeyFile "/opt/local/etc/apache2/server.key" --- > SSLCertificateKeyFile "/opt/local/etc/apache2/conf/server.key" |
|
1 2 3 4 5 6 7 8 9 10 |
[Sat Feb 01 17:44:28.904130 2020] [ssl:emerg] [pid 37616] AH02562: Failed to configure certificate w ww2.lo.k-in.co.jp:443:0 (with chain), check /opt/local/etc/apache2/conf/server.csr [Sat Feb 01 17:44:28.904361 2020] [ssl:emerg] [pid 37616] SSL Library Error: error:0909006C:PEM rout ines:get_name:no start line (Expecting: TRUSTED CERTIFICATE) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile? [Sat Feb 01 17:44:28.904611 2020] [ssl:emerg] [pid 37616] SSL Library Error: error:140DC009:SSL routines:use_certificate_chain_file:PEM lib AH00016: Configuration Failed [Sat Feb 01 17:47:38.836148 2020] [ssl:emerg] [pid 37658] AH02562: Failed to configure certificate www2.lo.k-in.co.jp:443:0 (with chain), check /opt/local/etc/apache2/conf/server.crt [Sat Feb 01 17:47:38.836586 2020] [ssl:emerg] [pid 37658] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecting: TRUSTED CERTIFICATE) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile? [Sat Feb 01 17:47:38.836610 2020] [ssl:emerg] [pid 37658] SSL Library Error: error:140DC009:SSL routines:use_certificate_chain_file:PEM lib AH00016: Configuration Failed |
errorでしばらく悩んでいたが、結果opensslで作る中間ファイルを最終結果だと思っていたことが判明。(バカな失敗)
2020.02.03
サーバのssl証明書を実際のものに置き換えると起動しなくなりました。秘密鍵・SSL証明書・中間証明書の三点きちんと入れたんですが、Apache2.4で中間証明書の扱いが変わったためと判明。
SSL証明書と中間証明書を単純にくっつけ、中間証明書の定義部分(SSLCertificateChainFile)をコメントアウトしておけばいいと判り試します。サーバーの名前が違うと怒られて起動しませんでした。実機でやらないといけないんだ…… (sigh)
参考にさせてもらったサイト
-
ろば電子が詰まつてゐる
:オレオレ証明書をopensslで作る(詳細版) -
Qiita
:httpsの設定とオレオレ証明書(自己署名証明書)の作成 -
DoRuby
:SSL証明書ペア確認コマンド -
あかつきのお宿
:Apache2.4 + mod_ssl + SSL証明書 = ちょいつまづく?


