Centos 7.4 openssl 都升级 1.0.2k-fips 了,为什么最新版 nginx 还是不支持 http2

2017-09-24 15:12:53 +08:00
 ColinZeb

nginx version: nginx/1.13.5

built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)

built with OpenSSL 1.0.1e-fips 11 Feb 2013

这是 mainline 版本,stable 版本也是这样。 用的 nginx 官方库,为啥 nginx 不用最新版 openssl 编译呢

8700 次点击
所在节点    NGINX
23 条回复
XiaoFaye
2017-09-24 15:17:37 +08:00
nginx 用 http2 可以呀,你的问题具体是?
LosLord
2017-09-24 15:21:24 +08:00
@XiaoFaye 之前 centos 的 openssl 版本低,就算启用 nginx 的 http2,也不会生效。
tangren
2017-09-24 15:24:34 +08:00
装了 openssl1.0.2 之后要重新编译 nginx+openssl hostname ssl http2
tangren
2017-09-24 15:26:30 +08:00
也可以装这个 nginx openresty 版本 默认就开了
rrfeng
2017-09-24 17:19:54 +08:00
一般 nginx 编译都是拉最新 openssl 的(当然不要跨大版本,除非你自己可以做完整的测试)

低版本 openssl 不支持 alpn 只有 npn,然而目前多数客户端已经废弃 npn 了,所以连不上 http2
Terenc3
2017-09-24 21:42:56 +08:00
升级系统的 openssl 后要重新编译 nginx,因为我一直是自行编译 nginx,所以不知道各个 yum 源的情况。

另外在编译的时候要启用以下两个模块:
--with-http_v2_module
--with-http_ssl_module

最后可以看一下我的文章:

https://c4.hk/4c
flynaj
2017-09-24 23:53:06 +08:00
nginx 官方的早就支持了
ColinZeb
2017-09-24 23:54:06 +08:00
@tangren 这个没用过,他的版本和 nginx 是同步的吗,比如 1.11 是指用的 nginx 的 1.11 的源码编译的吗
ColinZeb
2017-09-24 23:55:01 +08:00
@flynaj 但是 centos 仓库里并没有支持,看 nginx -V 里的 openssl 版本还是 1.01e
tradzero
2017-09-25 00:34:57 +08:00
貌似 rpm 源 用高版本编译的在商业版本里 特地要卖你钱
msg7086
2017-09-25 06:21:52 +08:00
@ColinZeb 你说的 centos 仓库,是说的 centos 官方的 repo,还是 EPEL 的 repo,还是 nginx 的 repo ?
ColinZeb
2017-09-25 08:14:29 +08:00
@msg7086 nginx 官方
byfar
2017-09-25 08:33:45 +08:00
都 12 楼了,怎么还没有推荐 docker 没记错 nginx:alpine 是支持 http2 的
Cat73
2017-09-25 09:06:28 +08:00
前两天我也遇到了这个问题。。。
找了个 rpm 源搞定的问题 0.0
ColinZeb
2017-09-25 09:29:49 +08:00
@Cat73 什么源
mritd
2017-09-25 09:35:11 +08:00
Docker nginx:alpine
owt5008137
2017-09-25 11:11:54 +08:00
我猜他打包 rpm 的机器还是 openssl 1.0.1 吧,编译的时候就决定好了各项开关了所以你单单升 openssl 没用。

https://github.com/owent-utils/bash-shell/blob/master/LNMP/nginx_with_http2_for_el7.sh
来来来,一键编译 nginx + openssl 1.1.0。稳定分支,编译选项从 nginx 官网抄的
msg7086
2017-09-25 11:29:15 +08:00
@ColinZeb nginx 的官方用的包不一定会跟着 centos 的最新版走。
Cat73
2017-09-25 13:59:52 +08:00
@ColinZeb 我用的 https://brouken.com/brouken.repo,不过我不能确保安全性,只能说这个是支持 HTTP2 的,因此你得自己鉴别确定安全再用。
Showfom
2017-09-25 15:14:15 +08:00
自己编译可破

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/393223

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX