为什么Chrome浏览器不能识别我的http2服务器? [英] why Chrome browser doesn't recognize my http2 server?

查看:514
本文介绍了为什么Chrome浏览器不能识别我的http2服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照数字海洋纸
和现在http2可用...



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

 名称方法状态协议
shell.js?v = xx .. GET 200 http / 1/1

我的服务器正在运行Ubuntu 16.04 LTS,它支持ALPN& NPN,以及随附的openssl版本是1.0.2g 我使用这个工具网站,结果是:

 是啊! example.com支持HTTP / 2.0。 ALPN支持... 

同时使用curl进行检查是可以的

  $ curl -I --http2 https://www.example.com 
HTTP / 2 200
server:nginx / 1.10.0( Ubuntu)
日期:2016年12月13日星期二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
变化: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不受www.amazon.com支持
支持的协议:http / 1.1

是-http2 www.example.com
✓由www支持的HTTP / 2 .example.com
支持的协议:h2 http / 1.1

为什么Chrome会落后它?
如何使用Safari(v 10.0.1)来检查它?

解决方案

可能是两个原因之一:


  1. 您正在使用防病毒软件,它会将您的流量降级到HTTP / 1.1。关闭AV上的https流量监控,直接连接到服务器。您可以使用一个在线工具来测试您的网站是否支持HTTP / 2,以检查是否属于这种情况


  2. 您使用的是较旧的TLS密码,特别是Chrome不允许使用HTTP / 2( https://http2.github.io/http2-spec/#BadCipherSuites )按照上述指南的步骤5。使用 https://www.ssllabs.com/ssltest/ 扫描您的网站以检查您的TLS配置和改善它。


第三个原因是你的SSL / TLS库缺乏ALPN支持(即你正在使用openssl 1.0.1并且需要一个1.0.2或后来,例如),但你已经确认你有ALPN支持,所以跳过这个答案。


I setup my Nginx conf as per Digital Ocean paper, and now http2 is available...

But in Chrome (Version 54.0.2840.98 (64-bit)) Dev tool, it's always on HTTP 1/1 :

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

my server is running Ubuntu 16.04 LTS which supports both ALPN & NPN , and the openssl version shipped with it is 1.0.2g

I checked http2 support with this tool siteand the result is :

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

Also checking with curl is OK

 $ 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

I also checked with is-http2 cli from my console

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

why Chrome is left behind it ? How can I check it also with Safari (v 10.0.1)

解决方案

Will likely be one of two reasons:

  1. You are using anti-virus software and it is MITM your traffic and so downgrading you to HTTP/1.1. Turn off https traffic monitoring on your AV to connect directly to the server. You can check if this is the case by using an online tool to test your site for HTTP/2 support.

  2. You are using older TLS ciphers and specifically one that Chrome disallows for HTTP/2 (https://http2.github.io/http2-spec/#BadCipherSuites) as per Step 5 of above guide. Scan your site using https://www.ssllabs.com/ssltest/ to check your TLS config and improve it.

The third reason is lack of ALPN support in your SSL/TLS library (i.e. You are using openssl 1.0.1 and need to be one 1.0.2 or later, for example) but you have already confirmed you have ALPN support so skipping that for this answer.

这篇关于为什么Chrome浏览器不能识别我的http2服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆