简体   繁体   English

一个IP地址和通配符证书,用于多个虚拟主机(Windows,Apache 2.4.2,OpenSSL 1.0.2e)

[英]One IP Address and Wildcard Certificate for multiple Virtual Hosts (Windows, Apache 2.4.2, OpenSSL 1.0.2e)

I have searched and searched but I cannot find a solution to my issue, so apologies if this sounds familiar, but I am at a loss. 我进行了搜索,但是找不到解决方案,因此,如果听起来很熟悉,我深表歉意,但是我很茫然。

I have: 我有:

  • Windows environment Windows环境
  • Apache 2.4.2 阿帕奇2.4.2
  • OpenSSL 1.0.2e OpenSSL 1.0.2e
  • one IP address (development box: 127.0.0.1) 一个IP地址(开发框:127.0.0.1)
  • multiple virtual hosts (www.site.co.uk, sub.site.co.uk, etc. ) 多个虚拟主机(www.site.co.uk,sub.site.co.uk等)
  • Genuine domain validated wildcard certificate from Comodo 来自Comodo的真实域验证的通配符证书

I need to use the wildcard certificate for all of my virtual hosts. 我需要为所有虚拟主机使用通配符证书。

All the sites work fine when using the standard http over port 80. 当通过端口80使用标准http时,所有站点均可正常运行。

When I enable httpd-ssl.conf, I start to get into trouble. 启用httpd-ssl.conf时,我开始遇到麻烦。

I have seen and tried several examples of http-ssl.conf configurations but all result in intermittent connection failures, ie Firefox: " Secure Connection Failed ", IE11: " This page cannot be displayed ". 我已经看过并尝试了几个http-ssl.conf配置的示例,但是所有示例都导致间歇性的连接失败,即Firefox:“ 安全连接失败 ”,IE11:“ 无法显示此页面 ”。 However , if I refresh the page (in each browser) the page displays and I can see that the certificate is valid. 但是 ,如果刷新页面(在每个浏览器中),则会显示该页面,并且可以看到证书有效。

From what I've read, it points to incorrect configuration of the http-ssl.conf, but I've tried the Mozilla SSL Configuration Generator ( https://mozilla.github.io/server-side-tls/ssl-config-generator/ ), many stackoverflow answers, but still no joy. 根据我的阅读,它指向http-ssl.conf的错误配置,但是我尝试了Mozilla SSL配置生成器( https://mozilla.github.io/server-side-tls/ssl-config -generator / ),许多stackoverflow答案,但仍然没有喜悦。

This is my current httpd-ssl.conf file: 这是我当前的httpd-ssl.conf文件:

Listen  443 https

SSLStrictSNIVHostCheck off

SSLPassPhraseDialog builtin
SSLSessionCache     "shmcb:C:/Apache2.4/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300
SSLProtocol         All -SSLv2 -SSLv3 
SSLCipherSuite      ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS

<VirtualHost 127.0.0.1:443>
    ServerName  www.site.co.uk
    ServerAlias www.site.co.uk
    DocumentRoot    C:\WebServer\Apache2.4\htdocs\www.site.co.uk

    SSLEngine On
    SSLCertificateFile "C:\WebServer\Apache2.4\conf\extra\ssl\site_wildcard.crt"
    SSLCertificateKeyFile "C:\WebServer\Apache2.4\conf\extra\ssl\site_wildcard.key"
    SSLCertificateChainFile "C:\WebServer\Apache2.4\conf\extra\ssl\site_wildcard.ca-bundle"
</VirtualHost>

<VirtualHost 127.0.0.1:443>
    ServerName  sub.site.co.uk
    ServerAlias sub.site.co.uk
    DocumentRoot    C:\WebServer\Apache2.4\htdocs\sub.site.co.uk
</VirtualHost>

After a lot of testing, my original comment did not solve the problem. 经过大量测试,我的原始评论未能解决问题。

The certificate was configured correctly. 证书配置正确。

When running tests, on websites like ssllabs.com, the protocol and handshake results would randomly differ, even though no configuration change had taken place. 在未进行配置更改的情况下,在ssllabs.com等网站上运行测试时,协议和握手结果将随机变化。

Testing/Verfiying with OpenSSL, sporadically produced the correct result, but the majority of time resulted in: 使用OpenSSL进行测试/验证偶尔会产生正确的结果,但是大部分时间导致:

ssl handshake failed SSL握手失败

It turns out the culprit was that I had this in my httpd.conf file: 原来的罪魁祸首是我在httpd.conf文件中有此文件:

AcceptFilter https none

After commenting it out, it solved the problem: 注释掉后,它解决了问题:

#AcceptFilter https none

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM