Chrome忽略alt-scv标头,不发送HTTP / 3请求

问题描述 投票:1回答:1

我一直在尝试在支持HTTP / 3的localhost上设置Web服务器。我已经成功运行了一个在docker中运行的球童服务器,该服务器使用此标头回答GET请求:

alt-svc: h3-27=":443"; ma=2592000
content-encoding: gzip
content-length: 1521
content-type: text/html; charset=utf-8
date: Thu, 07 May 2020 07:27:44 GMT
server: Caddy
status: 200
vary: Accept-Encoding
X-DNS-Prefetch-Control: off

即使收到alt-scv标头,我也无法在开发人员工具的网络日志中检测到任何h3-27请求。

[还创建了一个CA,我将其添加到chrome,并签署了Chrome接受的服务器的证书。按照article的建议,我运行了带有标志-enable-quic --quic-version =“ h3-27”的Chrome。我已经在基于[image]的Nginx服务器上尝试了相同的方法,但无法使其正常工作。

我想念什么?

Caddyfile:

{
    experimental_http3
}

localhost {
    root * /usr/share/caddy/
    encode zstd gzip
    templates
    file_server
    tls /etc/caddy/certs/localhost.crt /etc/caddy/certs/localhost.key
}

球童输出:

2020/05/07 07:23:50.939 INFO    using provided configuration    {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
2020/05/07 07:23:51.252 INFO    admin   admin endpoint started  {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["127.0.0.1:2019", "localhost:2019", "[::1]:2019"]}
2020/05/07 07:23:51 [INFO][cache:0xc00088da90] Started certificate maintenance routine
2020/05/07 07:23:51 [WARNING] Stapling OCSP: no OCSP stapling for [localhost bar.localhost]: no OCSP server specified in certificate
2020/05/07 07:23:51.254 INFO    http    skipping automatic certificate management because one or more matching certificates are already loaded  {"domain": "localhost", "server_name": "srv0"}
2020/05/07 07:23:51.254 INFO    http    enabling automatic HTTP->HTTPS redirects    {"server_name": "srv0"}
2020/05/07 07:23:51.255 INFO    tls cleaned up storage units
2020/05/07 07:23:51.256 INFO    http    enabling experimental HTTP/3 listener   {"addr": ":443"}
2020/05/07 07:23:51.257 INFO    autosaved config    {"file": "/config/caddy/autosave.json"}
2020/05/07 07:23:51.257 INFO    serving initial configuration
google-chrome nginx caddy http3
1个回答
0
投票

我自己找到原因。当前版本的Chrome(版本81.0.4044.138)不支持此版本的Quic(h3-27)。可以使用chrome-dev(版本84.0.4136.5)进行修复。

© www.soinside.com 2019 - 2024. All rights reserved.