httpdを起動したらSSL証明書のエラー

SSL証明書の入れ替え後、apache再起動したら失敗したときのメモ。

apacheのログ

[error] Unable to configure RSA server private key
[error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

csrの鍵確認

# openssl req -text -noout -in hoge.csr
(snip)
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
                Modulus (2048 bit):
                    00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:
                    00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:
(snip)

SSL証明書の鍵確認

# openssl x509 -text -noout -in hoge.crt
(snip)
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
                Modulus (2048 bit):
                    00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:
                    00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:
(snip)

Modulus部分が一致してるか確認

  • 違ってたら何かを取り違えているので、落ち着いて探す。

facebook slideshare rubygems github qiita