是否可以gnutls+http/2.0

2016年8月10日 | 分类: 【技术】

参考:https://www.v2ex.com/t/298288#reply5

fcicq(https://www.v2ex.com/member/fcicq)回答:

mod_h2 的代码, 不可能. 代码已经写死用 mod_ssl 了.
nghttp2 也是 openssl/libressl only 的项目
只是有人尝试用过 gnutls.

既然如此,计划使用多证书的,那只能不期望使用 http/2.0 了。

当禁用mod_gnutls时:

可以正常输出。

Firefox:

Content-Encoding: gzip
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Date: Wed, 10 Aug 2016 02:13:43 GMT
Server: Apache/2.4.23 (Unix) OpenSSL/1.0.2h PHP/5.6.24
Vary: Accept-Encoding
X-Firefox-Spdy: h2
X-Powered-By: PHP/5.6.24

chrome://net-internals/#http2

capturing events (180)

HTTP/2 Enabled: true
SPDY/3.1 Enabled: false
Use Alternative Service: false
ALPN Protocols: h2,http/1.1
NPN Protocols: undefined

当启用mod_gnutls时:

Firefox:

Connection: Upgrade, Keep-Alive
Content-Encoding: gzip
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Date: Wed, 10 Aug 2016 02:30:22 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.23 (Unix) OpenSSL/1.0.2h PHP/5.6.24 mod_gnutls/0.7.5 GnuTLS/3.5.2
Upgrade: h2
Vary: Accept-Encoding
X-Powered-By: PHP/5.6.24

chrome://net-internals/#http2

HTTP/2 Enabled: true
SPDY/3.1 Enabled: false
Use Alternative Service: false
ALPN Protocols: h2,http/1.1
NPN Protocols: undefined