日期:2014-5-17 浏览次数:20165次 点赞次数:20

apache2.2配置ssl双向认证
httpd.conf文件:
ServerAdmin biankai@TESTMERCHANT
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

extra/httpd-ssl.conf文件:
Listen 7443
<VirtualHost _default_:7443>
ServerName TESTMERCHANT:7443(依据自己开启的端口设置)
ServerAdmin biankai@TESTMERCHANT
SSLCertificateFile "F:/ssl/TESTMERCHANT.crt"
SSLCertificateKeyFile "F:/ssl/TESTMERCHANT.key"
SSLCACertificateFile "F:/ssl/trust.crt"
SSLVerifyClient require
SSLVerifyDepth  10

测试程序访问:
https://127.0.0.1:7443/

应答日志:
2012-5-23 17:59:41 twoway.HttpsUtil post
信息: Request message:[Hello] to https://127.0.0.1:7443/
2012-5-23 17:59:42 twoway.HttpsUtil post
信息: Response message:[<html><body><h1>It works!</h1></body></html>] from https://127.0.0.1:7443/
result: <html><body><h1>It works!</h1></body></html>