当位置指令设置时,客户端证书authenticationsslv3警报握手失败

我正在尝试为在Rails上运行的Web服务设置客户端证书身份validation。 该服务在apache2,passenger和mod_ssl上运行。 我已经能够成功地生成密钥并为整个域设置客户端证书身份validation。 这工作正常,但是,当我尝试包括位置指令时,我总是得到这个错误(从浏览器和ruby客户端):

SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError). 

当我从curl运行命令,我得到这个错误:

 curl: (52) Empty reply from server 

我删除该指令,它工作正常。 这是什么我这个虚拟主机confiration看起来像。

  <VirtualHost *:443 *:80> ServerName wrangler.optimis.local DocumentRoot "/Users/jmoore/Sites/data-wrangler/public/" RackEnv development ErrorLog "/Users/jmoore/Sites/data-wrangler/log/error.log" CustomLog "/Users/jmoore/Sites/data-wrangler/log/access.log" common SetEnv GEM_HOME /Users/jmoore/.rvm/gems/ree-1.8.7-2010.02 SetEnv GEM_PATH /Users/jmoore/.rvm/gems/ree-1.8.7-2010.02 # Enable SSL on this domain SSLEngine on SSLProtocol ALL SSLCipherSuite HIGH:MEDIUM SSLCertificateFile /etc/apache2/ssl.key/new/wrangler_servercert.pem SSLCertificateKeyFile /etc/apache2/ssl.key/new/wrangler_server.nopass.key # Enable SSL client certificates, but disable verification for the entire domain (we only want it on specific URLs) #SSLCACertificatePath /etc/apache2/ssl.key/new/demoCA SSLCACertificateFile /etc/apache2/ssl.key/new/demoCA/cacert.pem #SSLCertificateChainFile /etc/apache2/ssl.key/new/demoCA/cacert.pem #SSLVerifyClient require SSLVerifyClient none #SSLVerifyDepth 1 <Location /test> SSLVerifyClient require SSLVerifyDepth 1 </Location> </VirtualHost> 

我的研究表明,这通常是由不良证书造成的,所以我已经多次重新生成证书,并且每次对整个域都可以正常工作,但是当我试图限制到一个位置时,却出现了握手错误。 由于这些configuration是由Apache文档build议,我不知道什么是错的。 是否有人知道如何解决当您尝试将客户端身份validation限制到一个位置时发生的握手问题?

您的服务器是否支持TLS重新协商扩展(RFC 5746)? 它是否有阻止重新协商的OpenSSL版本(这是CVE-2009-3555的临时修订)?

如果SSLVerifyClient仅限于一个位置,则需要第二次握手来重新协商客户端证书。 这就是SSL / TLS(CVE-2009-3555)中的安全问题发生的地方,以及RFC 5746修复的问题(如果客户端也支持的话)。

有关这个StackOverflow答案中的版本的更多信息。

问题是SSLVerifyClient指令。 如果位于某个位置或目录中,则会出现此问题。 必须将SSLVerifyClient require和SSLVerifyDepth设置为虚拟主机级别。