或许有人会问我为啥那么久不更新 其实站点一直有在维护 但是呢優子秉承不发重复 不转帖 不伪原创。因此不会发不是自己倒腾过的东西出来的
今晚睡得晚 错过了睡点 于是直接失眠了QAQ。就想着折腾点啥打发时间 看着谷歌的SSL就有了自己折腾一个和谷歌一样前卫的HTTPS的想法
闲话到此为止
支持新版本TLS协议和ECDHE_RSA加密需要最低openssl1.0.1 而CentOS6通过默认源yum安装的openssl版本只有1.0.0 是不支持新版本TLS协议和ECDHE_RSA密钥交换方式的
一开始本想自己编译openssl 后来一想 自己编译会跟系统的openssl脱节 从而产生一些问题。谷歌是最好的老师 搜到了一个自定义源 里面有已经编译好的新版本openssl
导入源【请注意 此源仅支持64位系统。32位系统的抱歉了 暂时无法找到合适的源】
CentOS5 x64:
rpm -ivh --nosignature http://rpm.axivo.com/redhat/axivo-release-5-1.noarch.rpm
CentOS6 x64:
rpm -ivh --nosignature http://rpm.axivo.com/redhat/axivo-release-6-1.noarch.rpm
通过源升级安装最新版openssl1.0.1e
yum –enablerepo=axivo update openssl
不出意外的话 确认按一次y 导入KEY按一次y 即可完成安装
此时再输入openssl查看version的话 应该会显示【OpenSSL 1.0.1e 11 Feb 2013】
重新编译nginx
印象中这步是必须的 因为似乎编译时引用了openssl的头文档 需要重新编译
即使不是不是必须的 升级到1.4.1支持spdy协议还是不错的
由于我采用的是lnmp一键包 可以直接使用一键包中的upgrade_nginx.sh升级或者重新编译。如果不是使用一键包的 大致步骤如下:
wget http://nginx.org/download/nginx-1.4.1.tar.gz
tar zxvf nginx-1.4.1.tar.gz
cd nginx-1.4.1
./configure –user=www –group=www –prefix=/usr/local/nginx【注:此处填你自己nginx安装目录 按照原先的编译参数 如果原先就没有 prefix直接去掉】 –with-http_stub_status_module –with-http_ssl_module –with-http_gzip_static_module –with-http_spdy_module【注:使用一键包的也需要修改一键包的编译参数 此处加上红色字段】 –with-ipv6
make
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old【移除+备份老nginx的可执行文件 具体路径是看你的安装方式】
cp objs/nginx /usr/local/nginx/sbin/nginx【复制新的可执行文件进去 具体路径也是看你的安装方式】
/usr/local/nginx/sbin/nginx -t【执行新的可执行文件 测试是否配置文件有问题 具体路径同上】
make upgrade
修改nginx配置文件
需要修改的部分很多 不能像以前两三行解决了
首先
listen 你的ip:443 spdy;#新增spdy协议
SSL部分:
ssl on;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;#新增TLSv1.1 TLSv1.2
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_session_timeout 5m;#新增SSL session支持 此处和上面的是设置超时和设置cache大小 减轻负载
ssl_stapling on;
ssl_stapling_verify on;#
ssl_certificate 你的公钥.crt;
ssl_certificate_key 你的私钥.key;
ssl_prefer_server_ciphers on;#设置由服务端决定加密方式 避免不安全问题
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH;#去除所有不安全加密方式。确保不会遭受BEAST攻击。设置ECDHE_RSA正向密钥交换方式
注:红字是新增部分 蓝字可能是以前就有 如果以前有就需要加入红字部分 没有就直接添加。黑字是开启SSL加密所必需的
设置完毕后 reload nginx即可。
此时可以关闭浏览器重新访问你的SSL连接 你会发现你也变成了使用ECDHE_RSA的高级用户了
你同时可以使用SSL在线测试工具:https://www.ssllabs.com/ssltest/analyze.html。不出意外的话你应该是会得A了
这是本站的评分:https://www.ssllabs.com/ssltest/analyze.html?d=tucao.org
至于RC4的问题 我发现谷歌也在用 所以无所谓了。
如果你是考虑完全使用SSL 抛弃不加密的HTTP 可以考虑添加一个严格SSL的header
add_header Strict-Transport-Security max-age=2592000;
注意这个条目需要同时加到不经过加密的80端口的server块和经过HTTPS加密的server块。并且要在不经过加密的server块里设置跳转。设置方式不多说了 谷歌一搜一堆
使用ECDHE_RSA的优势:
1、具有良好前瞻性的密钥交换方式 保证数据安全
2、可以提升SSL握手速度 间接提升网站速度
3、和SPDY协议联合 最大限度提升HTTPS效率
至于见鬼的IE6的兼容问题呢 優子经过测试 XP 下的IE6是没有访问问题的 不需要担心。
p.s.总感觉“正向加密”这个词翻译有点怪?
~以上~
参考了以下文章:
https://blog.hasgeek.com/2013/https-everywhere-at-hasgeek
https://www.axivo.com/community/threads/upgrade-to-openssl-1-0-1-in-centos.180/
评论
CoolSculpting in Amarillo Texas helped me regain my confidence. Thank you! coolsculpting clinic amarillo
What’s your favorite type of roof? Share your thoughts after visiting best roofing contractor
нетслов ето зачот
Here are the main of the advantages of 1win https://escapadasfindesemana.eu/1win-aviator-apk-download-discover-the-thrills-of/ 1win Casino. 1win provides promo codes for ordering unique rewards and incentives on its own website.
Hi there everyone, it’s my first go to see
at this web site, and piece of writing is really
fruitful for me, keep up posting these posts.
sabung ayam sv388的最新文章:sabung ayam sv388
The teamwork between safeguard guards and regional law enforcement is obligatory for network safe practices tasks! Security Guard Services
Appreciate the great suggestions. For more, visit https://maps.app.goo.gl/FbPR23Spx5doDbYPA .
Appreciate the helpful advice. For more, visit Plantation flood pumping service .
Nicely done! Discover more at https://maps.app.goo.gl/jwcNQqUkf2aqanTV6 .
I love how each region in India has its own unique flavors! Get inspired by visiting indian buffet near me .
buy viagra online
Thanks for the great explanation. More info at Better Life Restoration .
I found this very interesting. For more, visit https://maps.app.goo.gl/aWjT54SzLq8YEnjY9 .
This was quite helpful. For more, visit IT Support services .
Fantastic advice on preparing for an international move! My choice of relying on St St. Petersburg moving company
I appreciate how transparent some clinics are about their procedures and results! Transparency builds trust—discover more at liposuction austin .
This was quite enlightening. Check out A Perfect Finish Painting for more.
I found this very interesting. Check out painting contractor Littleton for more.
This was very beneficial. For more, visit kitchen remodeling .
Thanks for the helpful article. More like this at bathroom remodelers company .
Wonderful tips! Discover more at Managed Service Provider nearby .
Every time they clean my windows, it’s like a breath of fresh air in my home—thank you, Lakeland Window Cleaning! lakeland window washing services
“Impressed by how professional Best Mesquite movers
This was very well put together. Discover more at design-build remodeling .
Mỗi lần đăng nhập vào ! # sun win # là một lần tôi được sống trong thế giới phiêu lưu đầy màu sắc ! sunwin
So excited about my new place in Daytona—thank you, Daytona Beach movers
Just moved into a beautiful home in Zellwood thanks to the awesome team at Best Zellwood movers !
Appreciate the detailed insights. For more, visit cabinet painting near me .
Không thể tin được rằng mình lại tìm thấy một thiên đường giải trí như thế này ở sun win! sunwin
Hello there! I could have sworn I’ve been to your blog before but after browsing through many
of the posts I realized it’s new to me. Anyhow, I’m certainly delighted I
came across it and I’ll be bookmarking it and checking back frequently!
big dick的最新文章:big dick
Thanks for the helpful article. More like this at residential painting service Littleton .
I enjoyed this article. Check out exterior painting Littleton for more.
If you’re feeling stressed about moving far away Long distance movers Clearwater
Used ### anykeyword# last week – they were prompt San Diego auto shippers
Clearly presented. Discover more at Phoenix Home Remodeling .
Well done! Discover more at shower remodeling Chandler .
This was very beneficial. For more, visit https://www.clipsnation.com/users/Phoenix_Home/ .
Nicely detailed. Discover more at https://youtu.be/sXBFa6xrwqw .
For anyone moving to or within Summerlin, definitely check out the services offered by Bushnell Mover’s
If you’re searching for quality movers in the area Davenport moving company
This article offers valuable tips on finding a reputable roofing contractor who provides transparent pricing and estimates roofing contractor
This was very beneficial. For more, visit kitchen remodeling near me .
I had no idea moving could be this easy until I hired professional long distance movers from Richardson! Long distance movers Richardson
Valuable information! Discover more at OnPoint Fencing and Decking .
If you’re looking to ship your car from Long Beach, make sure to check out the latest options available Long Beach auto shipping
If you want to save on your next move Cocoa full service movers
I had a fantastic experience with Kerner Law Group, P.C. as my Bronx car accident attorney!
Kerner Law Group, P.C. truly stands out as the best Bronx car accident lawyer I’ve ever worked with Law firm
Building a community around your brand through relationship marketing can be incredibly beneficial for small businesses! real estate client follow-up system
Appreciate the thorough insights. For more, visit https://maps.app.goo.gl/SVmjntSLpoACGCZt6 .
It’s the best time to make some plans for the long run and it’s time to be happy.
I have learn this publish and if I may I want to suggest
you few interesting things or tips. Perhaps you could write next articles referring
to this article. I want to learn even more things approximately it!
Joint Genesis reviews的最新文章:Joint Genesis reviews
Just wanted to say thanks to Long Beach car shippers for making my Long Beach trip smooth with their excellent transport services