我在一台服务器上有两个不同的网站: a.com和b.com 。
所以,我决定使用b.com SSL端口444。 但是,似乎所有的浏览器都会给出错误信息:
Chrome: Error 107 ssl protocol error Firefox: Error code: ssl_error_rx_record_too_long Epiphany: SSL handshake failed
嗯..我不知道为什么,但我确实看到一些网站可以访问像https://example.com:1443 。
还是我错过了什么?
ports.conf:
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 NameVirtualHost *:444 Listen 443 Listen 444 </IfModule> <IfModule mod_gnutls.c> Listen 443 Listen 444 </IfModule>
b.site:
<VirtualHost *:444> ServerName www.b.com:444 ServerAdmin [email protected] LogLevel error ErrorLog /var/log/apache2/b_error.log CustomLog /var/log/apache2/b_access.log combined DocumentRoot ... <Directory ...> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> SSLEngine on SSLCertificateFile /etc/ssl/certs/b.crt SSLCertificateKeyFile /etc/ssl/private/b.pem </VirtualHost>
CAconfiguration文件生成证书:
[ca] default_ca = CA_default [CA_default] x509_extensions = root_ca_extensions [req] default_bits = 4096 default_keyfile = distinguished_name = req_distinguished_name attributes = req_attributes prompt = no x509_extensions = v3_ca req_extensions = v3_req [req_distinguished_name] C = ... ST = .. O = ... OU = .. CN = ... emailAddress = [email protected] [req_attributes] [root_ca_extensions] basicConstraints = CA:true [v3_ca] basicConstraints = CA:true [v3_req] basicConstraints = CA:false keyUsage = nonRepudiation, digitalSignature, keyEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = b.com DNS.2 = www.b.com
答案是肯定的。
这是我的错误,我在/etc/hosts设置了127.0.0.1 www.b.com 。 然后,然而,我改变远程服务器的Apacheconfiguration文件,我的浏览器总是解决www.b.com到我的本地主机,那里有一个破损的证书。
不是100%确定,如果这是问题..但尝试从ServerName行中删除:444,所以它看起来像
ServerName www.b.com
该端口是不需要的,因为浏览器连接在该端口上,但无论使用哪个端口,主机头仍然是www.b.com。