webdevqa.jp.net

証明書のインストール後にhttpdが起動しない

私はSSL証明書を取得し、ubuntuを実行しています

domain.crtおよびdomain.ca-bundleファイルと、指定されたフォルダー内にありますが、これらのエラーが何度も発生します

[Sat Jul 27 06:35:00 2013] [error] Unable to configure verify locations for client authentication
[Sat Jul 27 06:35:00 2013] [error] SSL Library Error: 218570875 error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
[Sat Jul 27 06:36:55 2013] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] (/etc/Apache2/sites-enabled/default-ssl:2)

私のport.confは

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/Apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
NameVirtualHost *:443
    Listen 443
</IfModule>

そして私のデフォルトのSSLは次のとおりです

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin [email protected]
        ServerName www.domain.com
        ServerAlias domain.com
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                           -----------
                        ---------------
 -------------------- more configs



#   SSL Engine Switch:
        #   Enable/Disable SSL for this virtual Host.
        SSLEngine on

        #   A self-signed (snakeoil) certificate can be created by installing
        #   the ssl-cert package. See
        #   /usr/share/doc/Apache2.2-common/README.Debian.gz for more info.
        #   If both key and certificate are stored in the same file, only the
        #   SSLCertificateFile directive is needed.
        #   SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateFile  /etc/ssl/private/domain.crt
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        SSLCertificateChainFile /etc/ssl/private/domain.ca-bundle
12
Anup

解決

これらを/etc/Apache2/Apache2.confに追加しました

SSLCertificateFile your.crt
SSLCertificateKeyFile your.key
SSLCertificateChainFile your_bundle.crt

長い部分

Apacheでsshを有効にしてファイル/usr/share/doc/Apache2.2-common/README.Debian.gzを読み取ると、メッセージが表示されました。

6) Message "Server should be SSL-aware but has no certificate configured" in
   error log

Since 2.2.12, Apache is stricter about certain misconfigurations concerning
name based SSL virtual hosts. See NEWS.Debian.gz for more details.

そしてニュースは言う:

  * The new support for TLS Server Name Indication added in 2.2.12 causes
    Apache to be stricter about certain misconfigurations involving name
    based SSL virtual hosts. This may result in Apache refusing to start
    with the logged error message:

        Server should be SSL-aware but has no certificate configured
        [Hint: SSLCertificateFile]

    Up to 2.2.11, Apache accepted configurations where the necessary SSL
    configuration statements were included in the first (default)
    <Virtualhost *:443> block but not in subsequent <Virtualhost *:443>
    blocks. Starting with 2.2.12, every VirtualHost block used with SSL must
    contain the SSLEngine, SSLCertificateFile, and SSLCertificateKeyFile
    directives (SSLCertificateKeyFile is optional in some cases).

    When you encounter the above problem, the output of the command

        egrep -ir '^[^#]*(sslcertificate|sslengine|virtualhost)' \
            /etc/Apache2/*conf* /etc/Apache2/*enabled

    may be useful to determine which VirtualHost sections need to be changed.

もっとあります。

21
juanpastas

SSL証明書の統合にこれらを試すことができます。これは、仮想ホストの下のhttpd.confファイルの下にあるはずです。SSL証明書が保護するサイトの仮想ホストセクションを見つけてください。

SSLCACertificateFile-これは、適切なルートCA証明書を指す必要があります。

SSLCertificateChainFile-これは適切な中間ルートCA証明書を指す必要があります

SSLCertificateFile-これは、エンドエンティティ証明書( "mydomain.crt"を呼び出したもの)を指す必要があります

SSLCertificateKeyFile –これは、証明書に関連付けられた秘密鍵ファイルを指す必要があります。

3
The Whisperer