记录一次升级https走过的坑
2017-05-12 14:48
225 查看
记录一次升级https过程中走过的坑
curl: (51) SSL: certificate subject name 'mp3.xxx.com' does not match target host name 'static.xxx.com'
升级 http://mp3.xxx.com http://static.xxx.com
为 https://mp3.xxx.com https://static.xxx.com
因在一台服务器上配置的两个域名都解析到本机,配置完后,发现页面的静态文件都无法加载
于是F12看了下,发现加载的证书和浏览器地址栏的域名竟然不一致。请求的static这个域名,确加
载的mp3的证书。用curl也报错,不能正常返回200,纳闷了!
[root@web ~]# curl -I https://static.xxx.com/static/lib/less.min.js curl: (51) SSL: certificate subject name 'mp3.xxx.com' does not match target host name 'static.xxx.com'
后来求助伟大的谷歌,发现原来是nginx的TLS SNI support功能没开,SNI (服务器名字指示)不开启的话,一个IP只支持一个SSL证书,不支持多个证书,而服务器是yum安装的nginx,默认TLS SNI support是关闭的,重新编译nginx并指定openssl库后,TLS SNI support 开启了,访问就正常了
yum update openssl
或
cd openssl-1.0.0d
./config --prefix=/usr/local/openssl
make && make install
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-http_addition_module --with-http_realip_module --with-openssl=/usr/local/src/openssl-1.0.0d
另外的一个问题是这种情况下用curl测试时,状态码不能正常返回200,开启LS SNI support后也依然报错,不能正常返回200。看curl官网有人反馈,这好像是curl版本7.15.5的BUG,用比7.15.5新的curl 7.19.7版本测试就正常。
curl: (51) SSL: certificate subject name 'mp3.xxx.com' does not match target host name 'static.xxx.com'
升级 http://mp3.xxx.com http://static.xxx.com
为 https://mp3.xxx.com https://static.xxx.com
因在一台服务器上配置的两个域名都解析到本机,配置完后,发现页面的静态文件都无法加载
于是F12看了下,发现加载的证书和浏览器地址栏的域名竟然不一致。请求的static这个域名,确加
载的mp3的证书。用curl也报错,不能正常返回200,纳闷了!
[root@web ~]# curl -I https://static.xxx.com/static/lib/less.min.js curl: (51) SSL: certificate subject name 'mp3.xxx.com' does not match target host name 'static.xxx.com'
后来求助伟大的谷歌,发现原来是nginx的TLS SNI support功能没开,SNI (服务器名字指示)不开启的话,一个IP只支持一个SSL证书,不支持多个证书,而服务器是yum安装的nginx,默认TLS SNI support是关闭的,重新编译nginx并指定openssl库后,TLS SNI support 开启了,访问就正常了
yum update openssl
或
cd openssl-1.0.0d
./config --prefix=/usr/local/openssl
make && make install
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-http_addition_module --with-http_realip_module --with-openssl=/usr/local/src/openssl-1.0.0d
另外的一个问题是这种情况下用curl测试时,状态码不能正常返回200,开启LS SNI support后也依然报错,不能正常返回200。看curl官网有人反馈,这好像是curl版本7.15.5的BUG,用比7.15.5新的curl 7.19.7版本测试就正常。
相关文章推荐
- 记录一次MVC3升级MVC4遇到的问题
- 记录一次升级迁移的过程
- 记录一次http切换成https,并修改域名过程的坑自己的经历
- 记录一次https的调试
- 记录一次阿里云服务器ubuntu14.04 lts升级
- 记录一次RAC升级的过程
- 记录一次阿里云部署https的大致经过
- 一次linux系统内核升级记录
- 记录一次给网站服务器添加SSL(https)的过程
- 一次linux系统内核升级记录 推荐
- ios升级https记录
- 【经验】记录一次MySQL升级的运维实践
- 记录一次惨痛的升级glibc 教训
- 记录一次CentOS环境升级Python2.6到Python2.7并安装最新版pip
- 记一次全站升级https引发的一系列问题
- 记一次 HTTPS升级
- Gridview一次更新所有记录
- 记一次rsyslog日志记录失败的解决过程