为什么Chrome浏览器不能识别我的nginx http2服务器?

我设置我的Nginx的conf 数字海洋纸 ,现在http2可用…

但在Chrome(版本54.0.2840.98(64位))开发工具,它始终在HTTP 1/1:

NAME METHOD STATUS PROTOCOL shell.js?v=xx.. GET 200 http/1.1 

我的服务器运行Ubuntu 16.04 LTS,它同时支持ALPN和NPN,并且随附的openssl版本是1.0.2g

我检查了这个工具网站的 http2支持,结果是:

 Yeah! example.com supports HTTP/2.0. ALPN supported... 

也检查curl是好的

  $ curl -I --http2 https://www.example.com HTTP/2 200 server: nginx/1.10.0 (Ubuntu) date: Tue, 13 Dec 2016 15:59:13 GMT content-type: text/html; charset=utf-8 content-length: 5603 x-powered-by: Express cache-control: public, max-age=0 etag: W/"15e3-EUyjnNnyevoQO+tRlVVZxg" vary: Accept-Encoding strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY x-content-type-options: nosniff 

我也从我的控制台检查is-http2 cli

 is-http2 www.amazon.com × HTTP/2 not supported by www.amazon.com Supported protocols: http/1.1 is-http2 www.example.com ✓ HTTP/2 supported by www.example.com Supported protocols: h2 http/1.1 

用我的本地主机openssl进行testing

 $ echo | openssl s_client -alpn h2 -connect www.example.com:443 | grep ALPN depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3 verify return:1 depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 verify return:1 depth=0 CN = example.com verify return:1 ALPN protocol: h2 DONE 

为什么Chrome留下来呢? 我怎样才能使用Safari(v 10.0.1)

根据我在StackOverflow的答案:

可能是以下两个原因之一:

  1. 您正在使用防病毒软件,它是MITM您的stream量,所以降级到H​​TTP / 1.1。 closuresAV上的httpsstream量监控,直接连接到服务器。

  2. 您正在使用较旧的TLS密码,特别是Chrome根据上述指南的第5步不允许使用HTTP / 2( https://http2.github.io/http2-spec/#BadCipherSuites )。 使用https://www.ssllabs.com/ssltest/扫描您的网站,检查您的TLSconfiguration并改进。

第三个原因是您的SSL / TLS库缺乏ALPN支持 (例如,您正在使用openssl 1.0.1,例如需要一个1.0.2或更高版本),但是您已经确认您拥有ALPN支持,因此跳过了这个答案。