2017-08-07 88 views
0

ディレクトリおよび証明書失効リスト(crl)でクライアント認証を使用してサーバーを構成しようとしています。私は一度クライアントクライアントの認証を動作させるのに成功しましたが、もはやそうではなく、取り消しリストの作成には成功しませんでした。Apacheクライアント認証:証明書検証:エラー(2):発行者証明書(SOLVE)を取得できません

  • デフォルト-ssl.confの

<IfModule mod_ssl.c> 
 
    <VirtualHost _default_:443> 
 
     ServerAdmin [email protected] 
 
\t \t DocumentRoot /var/www/html \t \t \t \t \t \t 
 
\t \t ErrorLog ${APACHE_LOG_DIR}/error.log 
 
\t \t CustomLog ${APACHE_LOG_DIR}/access.log combined 
 
\t \t \t \t \t \t \t \t 
 
\t \t SSLEngine on 
 
\t \t SSLCertificateFile \t /root/ca/intermediate/certs/www.example.com.cert.pem 
 
\t \t SSLCertificateKeyFile /root/ca/intermediate/private/www.example.com.key.pem 
 
\t \t SSLCertificateChainFile /root/ca/intermediate/certs/ca-chain.cert.pem 
 
\t \t SSLCACertificateFile /root/ca/intermediate/certs/intermediate.cert.pem \t \t 
 
\t \t \t \t \t \t \t \t 
 
\t \t <FilesMatch "\.(cgi|shtml|phtml|php)$"> 
 
\t \t  SSLOptions +StdEnvVars 
 
\t \t </FilesMatch> 
 
\t \t <Directory /usr/lib/cgi-bin> 
 
\t \t \t SSLOptions +StdEnvVars 
 
\t \t </Directory> \t 
 
\t </VirtualHost> 
 
</IfModule>

  • apache2.conf
:ここ

は私の設定ファイルです

Mutex file:${APACHE_LOCK_DIR} default 
 
PidFile ${APACHE_PID_FILE} 
 
Timeout 300 
 
KeepAlive On 
 
MaxKeepAliveRequests 100 
 
KeepAliveTimeout 5 
 

 

 
User ${APACHE_RUN_USER} 
 
Group ${APACHE_RUN_GROUP} 
 

 
HostnameLookups Off 
 

 
ErrorLog ${APACHE_LOG_DIR}/error.log 
 

 
LogLevel warn 
 

 
IncludeOptional mods-enabled/*.load 
 
IncludeOptional mods-enabled/*.conf 
 

 
Include ports.conf 
 

 

 
<Directory /> 
 
    Options FollowSymLinks 
 
    AllowOverride None 
 
    Require all denied 
 
</Directory> 
 

 
<Directory /usr/share> 
 
    AllowOverride None 
 
    Require all granted 
 
</Directory> 
 

 
<Directory /var/www/> 
 
    Options Indexes FollowSymLinks 
 
    AllowOverride None 
 
    Require all granted 
 
</Directory> 
 

 
<Directory /var/www/html/testClientCert> 
 
    Options Indexes FollowSymLinks 
 
    AllowOverride None 
 
    SSLVerifyClient require 
 
    SSLVerifyDepth 10 
 
</Directory> 
 

 
AccessFileName .htaccess 
 

 
<FilesMatch "^\.ht"> 
 
    Require all denied 
 
</FilesMatch> 
 

 
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined 
 
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined 
 
LogFormat "%h %l %u %t \"%r\" %>s %O" common 
 
LogFormat "%{Referer}i -> %U" referer 
 
LogFormat "%{User-agent}i" agent 
 

 
IncludeOptional conf-enabled/*.conf 
 

 
IncludeOptional sites-enabled/default-ssl.conf

Iは、ルートおよび中間体ACを作成するには、次のtutoを使用する:(パート1および2)https://jamielinux.com/docs/openssl-certificate-authority/

Iは、クライアント証明書を生成するために、以下のコマンドを使用:

4 - 4.1クライアント証明書を作成し、クライアントを作成し、キー opensslのgenrsa -out -des3 client.key 4096

4.2 Create the client csr 
    openssl req -new -key client.key -out client.csr 

4.3 Create the client certificate 
    openssl x509 -req -days 365 -in client.csr -CA /root/ca/intermediate/certs/intermediate.cert.pem -CAkey /root/ca/intermediate/private/intermediate.key.pem -set_serial <mettre une valeur à changer à chaque cert genre à incrémenter (01 pour le premier puis 02...> -out client.crt 

4.4 Convert client certificate to PKCS 
    openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12  

ここで私の中間証明書は信頼されていないようです。確かに、Mozillaで/ var/www/html/testClientCertディレクトリにアクセスしようとすると(Mozillaで中間AC +クライアント証明書をインポートしました)私は次のエラーを持っている:

tail -f 20 /var/log/apache2/* 
 

 
==> /var/log/apache2/access.log <== 
 
127.0.0.1 - - [07/Aug/2017:20:15:48 +0200] "GET /testClientCert/gg.txt HTTP/1.1" 403 9768 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0" 
 

 
==> /var/log/apache2/error.log <== 
 
[Mon Aug 07 20:15:48.741592 2017] [ssl:error] [pid 2262:tid 140536910403328] [client 127.0.0.1:55376] AH02039: Certificate Verification: Error (2): unable to get issuer certificate 
 
[Mon Aug 07 20:15:48.741670 2017] [ssl:error] [pid 2262:tid 140536910403328] [client 127.0.0.1:55376] AH02261: Re-negotiation handshake failed 
 
[Mon Aug 07 20:15:48.741687 2017] [ssl:error] [pid 2262:tid 140536910403328] SSL Library Error: error:14089086:SSL routines:ssl3_get_client_certificate:certificate verify failed

どのように私は、ルートACの証明書と、私のクライアント証明書は、中間ACによって署名された中間の交流証明書に署名したのに対し、エラーが発生していますか?

答えて

0

回答が必要な人は、私が投稿します。デフォルトの設定ファイル(デフォルト-ssl.confの)内のコメントは良いトラックに私を導く:

# Certificate Authority (CA): 
    # Set the CA certificate verification path where to find CA 
    # certificates for client authentication or alternatively one 
    # huge file containing all of them (file must be PEM encoded) 

ので、ファイルSSLCACertificateFileがルートと中間証明書が含まれている必要があります。そして、このラインの変更は私の問題を解決:

SSLCACertificateFile /root/ca/intermediate/certs/ca-chain.cert.pem

私はまだCRLのための解決策を見つけることがあり、私はそれを投稿します私はそれを見つけるとき。