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



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

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

但如果我访问网站https://www.example.com,我得到一个ERR_SSL_PROTOCOL_ERROR

我还尝试运行以下程序:

openssl s_client -connect www.example.com:443

它输出这个:

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>

在/etc/apache2/sites-enabled/example.conf中,我确保443的虚拟服务器有一系列设置,而不仅仅是80,它包括以下内容:

<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>

我仍然有一个想法,那就是通过简单地再次执行CSR,但没有通用名称中的www,也许这将解决所有这些问题。但在我回到客户(我已经做了几次了(之前,我想看看这是否真的能解决问题

更新

因此,在昨晚的混乱中,我花时间将服务器从12.04升级到14.04。这让诊断变得更容易了,因为我的另一台服务器上有大约20个站点,运行正常,在14.04上。

我还确保启用default-ssl.conf和000-default.conf来确保这一点。使用sudo tail-40/var/log/apache2/error.log查看一些SSL日志我能看到的只是一条消息:

[ssl:warn] [pid 6905] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)

我也试过这个:

nmap --script +ssl-enum-ciphers example.com

它显示端口443是打开的,但没有显示该端口的ssl枚举密码。

更新2

尝试了一个新的证书。仍然不起作用。但我刚刚通过Firefox加载了该网站,看到了以下内容:ERR_SSL_procol_ERROR

如果Listen 443打开,但Virtualhost没有为443设置,但.conf文件肯定是..,则可能会发生这种情况

哦,我的上帝。

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

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

最新更新