2015-02-24 69 views
2

我有一个Apache的设备存在问题,将不匹配从客户端访问的服务器名称,造成了警告:设置Apache的虚拟主机,表示正常SNI握手

TLSv1.2工作记录层:警报(级别:警告,描述:无法识别的名称)

我非常确定这与我的VirtualHost配置有关。尽管我已经为所有主机设置了ServerName和ServerAlias,但服务器并没有发回服务器名称。

这里是我的Apache配置:

<VirtualHost *:80> 
    ServerName example.io 
    ServerAlias example.io 
    Redirect permanent/https://example.io 
</VirtualHost> 

<VirtualHost *:80> 
    ServerName api.example.io 
    ServerAlias api.example.io 
    Redirect permanent/https://api.example.io 
</VirtualHost> 

<VirtualHost *:80> 
    ServerName store.example.io 
    ServerAlias store.example.io 
    Redirect permanent/https://store.example.io 
</VirtualHost> 

<VirtualHost *:443> 
    ServerName example.io 
    ServerAlias example.io 
    DocumentRoot /var/www/html 

    SSLEngine on 
    SSLCertificateFile /path/file.crt 
    SSLCertificateKeyFile /path/file.key 
    SSLCertificateChainFile /path/file.crt 

    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

任何帮助,将不胜感激!

+0

“我的Apache机器出现问题,不会返回服务器名称,这会导致某些实施SNI的客户端返回错误。” - 这对我来说没有意义。客户端发送它期望在ClientHello中的服务器名称。服务器没有返回服务器名称。 – 2015-02-24 17:36:06

+0

你说得对,我误解了这一点。客户端发送它期望的服务器名称,但它不匹配,Apache发回警告。我会更新我的问题。 – Stromgren 2015-02-24 17:37:53

+0

您只配置了一个证书。此证书已发送。如果证书的内容与期望的名称不符,客户会抱怨。对于SNI,您需要多个证书。或者您拥有多个名称的证书,在这种情况下您甚至不需要SNI。 – 2015-02-24 17:39:34

回答

4

这不是SNI的问题,而是缺少链式证书的问题。从SSLLabs报告:

Chain issues Incomplete 
... 
2 Extra download RapidSSL SHA256 CA - G3 
Fingerprint: 0e34141846e7423d37f20dc0ab06c9bbd843dc24 

桌面浏览器都这些失踪的证书链往往从其他网站缓存或下载。在这种情况下,其他应用程序或移动浏览器大都失败。

除此之外,您还有其他设置问题,例如提供弱密码(RC4)和协议(SSL3.0)。

TLSv1.2工作记录层:警告(级别:警告,说明:无法识别的名称)

这可能是因为你有一个服务器名称example.io但客户端使用www.example.io这与您提供的ServerName不匹配。您不会在客户端发生错误,因为证书与客户端使用的名称相匹配。您应该使用

ServerAlias example.com *.example.com 

使此警告消失。

+0

非常感谢您的回答。 ServerAlias在警告方面做了工作。如果能够解决连锁问题。我不知道可以将多个中间证书串联在一起,这就造成了我的问题。 – Stromgren 2015-02-24 19:13:44