关于错误代码107(err_ssl_protocol_error)SSL协议出错的解决方案是什么,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
关于错误代码107(err_ssl_protocol_error)SSL 协议出错的解决方案
火狐浏览器访问 https://www.abc.com 出现一个很怪异的问题,报错:
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.abc.com;
root /data0/htdocs/zhaolilei;
index index.html index.PHP;
rewrite ^/ https://www.abc.com 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.abc.com;
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了
看完上述内容,你们掌握关于错误代码107(err_ssl_protocol_error)SSL协议出错的解决方案是什么的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。