售前咨询
技术支持
渠道合作

关于错误代码107(err_ssl_protocol_error)SSL 协议出错的解决方案

火狐浏览器访问 https://www.trustauth.cn 出现一个很怪异的问题,报错:

ssl 107 (net::ERR_SSL_PROTOCOL_ERROR)

刚开始以为是ssl失效了,重新安装了一遍

安装过程:

第一步# openssl genrsa -des3 -out server1.key 1024
Generating RSA private key, 1024 bit long modulus
……++++++
……..++++++
e is 65537 (0x10001)
Enter pass phrase for server1.key:此处设置个密码
Verifying – Enter pass phrase for server1.key:重新输入设置个密码

第二步# openssl req -new -key server1.key -out server1.csr
Enter pass phrase for server1.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:Beijing
Locality Name (eg, city) [Newbury]:Beijing
Organization Name (eg, company) [My Company Ltd]:xo
Organizational Unit Name (eg, section) []:xo
Common Name (eg, your name or your server’s hostname) []:xo
Email Address []:

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:此处回车
An optional company name []:此处回车

第三步:#cp server1.key server1.key.org

第四步:# openssl rsa -in server1.key.org -out server1.key
Enter pass phrase for server1.key.org:此处输入刚才设置的密码
writing RSA key

第五步:]# openssl x509 -req -days 365 -in server1.csr -signkey server1.key -out server1.crt
Signature ok
subject=/C=CN/ST=Beijing/L=Beijing/O=xo/OU=xo/CN=xo
Getting Private key

安装完ssl,配置nginx虚拟主机

server
{
listen 80;
server_name  www.trustauth.cn;
root /data0/htdocs/zhaolilei;
index index.html index.PHP;
rewrite ^/  https://www.trustauth.cn permanent;

location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
access_log /data1/logs/test1.log;
}

server
{
listen 443;
server_name  www.trustauth.cn;
root /data0/htdocs/zhaolilei;
index index.html index.php;

ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;

location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
access_log /data1/logs/test.log;
}

配置完后访问测试,依然是报错,后来在网上查了N多资料也没有个说法

静下来想想,这个之前是好用的,最近貌似只升级过nginx版本为1.2.1,难道与版本有关,新版本的nginx有一些规则改了,比如:日志格式要放在虚拟主机上边定义,后可官网也没有查出相关问题。猜想会不会与虚拟主机的顺序有关,我这里先配置的80,后配置的443

经过测试,果然如此,把443的虚拟主机放置到80的上边,重启nginx,访问OK了

SSL证书采用了技术含量比较高的加密技术。日后GDCA(数安时代)将会持续为大家推荐更多关于SSL证书的技术知识。让大家正确认识SSL证书,快速无误部署HTTPS安全协议。更多资讯,请关注GDCA。

上一篇:

下一篇:

相关新闻

 

领取优惠
免费预约

申请试用SSL证书

提交成功!

咨询客服