V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
talas
V2EX  ›  SSL

纠结: mod_gnutls 启用时不能输出 h2,禁用后使用 OpenSSL 能够输出 h2,是哪里配置错了么?

  •  
  •   talas · 2016-08-10 09:24:27 +08:00 · 2167 次点击
    这是一个创建于 2809 天前的主题,其中的信息可能已经有所发展或是发生改变。
    多谢!

    环境: Apache/2.4.23 (Unix) OpenSSL/1.0.2h PHP/5.6.24 mod_gnutls/0.7.5 GnuTLS/3.5.2
    5 条回复    2016-08-11 01:36:58 +08:00
    just4test
        1
    just4test  
       2016-08-10 09:30:19 +08:00
    h2 这个缩写也是不错
    talas
        2
    talas  
    OP
       2016-08-10 10:40:12 +08:00
    当禁用 mod_gnutls 时:

    Firefox 显示:版本: http/2.0

    响应头:

    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

    测试:

    nghttp -v https://domain.org

    输出:

    [ 0.098] Connected
    The negotiated protocol: h2
    ...

    当启用 mod_gnutls 时:

    Firefox 显示:版本: http/1.1

    响应头:

    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

    测试:

    nghttp -v https://domain.org

    输出:

    [ 0.240] Connected
    The negotiated protocol: http/1.1
    [ERROR] HTTP/2 protocol was not selected. (nghttp2 expects h2)
    Some requests were not processed. total=1, processed=0

    怎样才能在使用 mod_gnutls 的情况下也能支持 HTTP/2 。
    fcicq
        3
    fcicq  
       2016-08-10 13:08:46 +08:00
    去瞅了一眼 mod_h2 的代码, 不可能. 代码已经写死用 mod_ssl 了.
    fcicq
        4
    fcicq  
       2016-08-10 13:12:21 +08:00
    另外 nghttp2 也是 openssl/libressl only 的项目, 只是有人尝试用过 gnutls.
    talas
        5
    talas  
    OP
       2016-08-11 01:36:58 +08:00
    多谢解惑。

    既然如此,计划使用多证书的,那只能不期望使用 http/2.0 了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   922 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 22:11 · PVG 06:11 · LAX 15:11 · JFK 18:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.