AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 820471
Accepted
erwin
erwin
Asked: 2016-12-14 09:42:53 +0800 CST2016-12-14 09:42:53 +0800 CST 2016-12-14 09:42:53 +0800 CST

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

  • 772

我根据 Digital Ocean 论文设置了我的 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 测试

$ 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) 检查它

nginx google-chrome http2
  • 1 1 个回答
  • 11141 Views

1 个回答

  • Voted
  1. Best Answer
    Barry Pollard
    2016-12-14T11:22:21+08:002016-12-14T11:22:21+08:00

    根据我对StackOverflow的回答:

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

    1. 您正在使用防病毒软件,它是 MITM 您的流量,因此将您降级到 HTTP/1.1。关闭 AV 上的 https 流量监控以直接连接到服务器。

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

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

    • 17

相关问题

  • Gzip 与反向代理缓存

  • nginx 作为代理的行为

  • Nginx 学习资源 [关闭]

  • 提供 70,000 个静态文件 (jpg) 的最佳方式?

  • 在 Apache、LightTPD 和 Nginx Web 服务器上提供 PHP 5.x 应用程序的现状?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve