Oct 162004
SSLのクライアント証明書を強制し、なおかつ特定の認証局で署名したクライアント証明書でなければ接続できないようにする方法。認証局の設置やSSLそのものの設定は割愛します。
Apacheの場合
httpd.conf等で以下のように設定します。
SSLCACertificateFile
に認証局の証明書ファイルを指定SSLVerifyClient require
でクライアント証明書を強制SSLVerifyDepth 1
でクライアント証明書の検証時に遡る認証局を制限(認証局が自己署名によるものなら実質不要)
Courier-IMAPの場合
imap-sslで以下のように設定します。
TLS_TRUSTCERTS
に認証局の証明書ファイルを指定TLS_VERIFYPEER=REQUIREPEER
を指定
これで認証局で署名されたクライアント証明書が提示されないと、接続を拒否するようになります。
opensslコマンドで接続すると、こんな感じ。
$ openssl s_client -connect servername:443 CONNECTED(00000003) depth=1 /C=JP/O=Organization verify error:num=19:self signed certificate in certificate chain verify return:0 15549:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1052:SSL alert number 40 15549:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:226: $
証明書を使用すると接続は成功します。
$ openssl s_client -connect cancer:443 -cert client.crt -key client.key CONNECTED(00000003) depth=1 /C=JP/O=Organization verify error:num=19:self signed certificate in certificate chain verify return:0 --- Certificate chain :
Sorry, the comment form is closed at this time.