测试 ALPN
测试 ALPN
openssl s_client -connect example.com:443 -alpn h2 </dev/null 2>/dev/null | grep -i alpn
curl -v --http2 https://example.com 2>&1 | grep -i 'ALPN'
# 观察 HTTP/2: curl -sI --http2 https://example.com | head -1协议标识
| 协议标识 | 含义 | 端口 |
|---|---|---|
| h2 | HTTP/2 over TLS | 443/tcp |
| http/1.1 | HTTP/1.1 | 443/tcp |
| h3 | HTTP/3 over QUIC | 443/udp |
服务器未配置 ALPN h2 时,浏览器自动回落 http/1.1——「HTTP/2 没生效」先查 ALPN。