Apache Ubuntu 14.04 Virtualmin虚拟服务器上的SSL显示未知协议

Apache Ubuntu 14.04 Virtualmin虚拟服务器上的SSL显示未知协议,apache,ssl,ubuntu-14.04,virtualmin,Apache,Ssl,Ubuntu 14.04,Virtualmin,我们有一个运行virtualmin的服务器,其中有多个网站位于虚拟服务器中。我以前从未在我们的另一台服务器上遇到过这个问题,但我们发布了一个CSR,从客户端获得了SSL并安装了它 安装后,我收到了一堆常见的名称错误。这似乎是因为SSL中的域包含www,您无法将其分配给虚拟服务器,因此它不匹配。然而,通过将www.domain.com包含在/etc/apache2/sites enabled/example.conf记录中,错误消失了 但是如果我访问这个网站,我会得到一个 错误\u SSL\u协议

我们有一个运行virtualmin的服务器,其中有多个网站位于虚拟服务器中。我以前从未在我们的另一台服务器上遇到过这个问题,但我们发布了一个CSR,从客户端获得了SSL并安装了它

安装后,我收到了一堆常见的名称错误。这似乎是因为SSL中的域包含www,您无法将其分配给虚拟服务器,因此它不匹配。然而,通过将www.domain.com包含在/etc/apache2/sites enabled/example.conf记录中,错误消失了

但是如果我访问这个网站,我会得到一个 错误\u SSL\u协议\u错误

我还尝试运行以下程序:

openssl s_client -connect www.example.com:443
<VirtualHost 123.123.123.123:443>
SuexecUserGroup "#1000" "#1000"
ServerName www.example.com
ServerAlias example.com
DocumentRoot /home/example/public_html
ErrorLog /var/log/virtualmin/example.com_error_log
CustomLog /var/log/virtualmin/example.com_access_log combined
ScriptAlias /cgi-bin/ /home/example/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/example/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/example/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 301
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/example/ssl.cert
SSLCertificateKeyFile /home/example/ssl.key
SSLCACertificateFile /home/example/ssl.ca
</VirtualHost>
哪个输出:

CONNECTED(00000003)
3073689800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:759:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 297 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
我检查了一下openssl是否显示端口443正在被监听。我还调整了ports.conf文件以包含更多细节:

#Listen 80
#Listen 443
NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    NameVirtualHost *:443
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>
我也试过这个:

nmap --script +ssl-enum-ciphers example.com
它显示端口443是打开的,但没有为该端口显示ssl枚举密码

更新2

尝试了新的证书。仍然不起作用。但我刚刚通过Firefox加载了该站点,并看到了以下内容: 错误\u SSL\u协议\u错误

如果Listen 443处于打开状态,但Virtualhost没有为443设置,但.conf文件肯定是..

哦,我的天哪,这可能会发生

所以我发现了问题。另一个虚拟主机网站也在virtualhost文件中为443添加了一个部分。然而,该网站没有正确配置为使用SSL,因为它不应该使用SSL


我一时兴起发现了这一点,并决定删除文件中的443条目,然后重新启动Apache。现在该网站加载良好

检查服务器配置的SSL版本。您可能正在请求未配置的版本。这不是www的问题。在这种情况下,您会收到一个不匹配错误。看起来像SSLv3和TLSv1.2,如何检查证书需要什么?我确实奇怪地看到Apache.conf中的默认设置是SSLv2..FWIW,这是一个正常工作的Apache vhost配置。我没有说它是最优的或完美的,但它正在工作:谢谢,我尝试了一下,但它实际上使apache停止了工作。
nmap --script +ssl-enum-ciphers example.com