diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2022-04-19 23:25:41 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2022-05-05 13:35:18 -0400 |
commit | fbade1850f5ceffdb2cf4c561fa44f73093a484d (patch) | |
tree | ac3ac6c6d389b908b3463f09629cd0174d4a14c8 /src/mod_wolfssl.c | |
parent | 1ed3a78ea9f51c33c348de6aaa02447d3ac54fae (diff) | |
download | lighttpd-git-fbade1850f5ceffdb2cf4c561fa44f73093a484d.tar.gz |
[multiple] reset http vers, avoid rare crash (fixes #3152)
(thx ultimator)
do not set r->http_version to HTTP_VERSION_2 when selecting TLS ALPN
if r->handler_module already set, since handler module is likely
mod_sockproxy, and con->h2 will not get initialized.
This does continue to select "h2", so the mod_sockproxy backend
should be prepared to receive the HTTP/2 client connection preface.
x-ref:
"Random Segfaults with version 1.4.64 w/ mod_sockproxy and ALPN h2"
https://redmine.lighttpd.net/issues/3152
Diffstat (limited to 'src/mod_wolfssl.c')
-rw-r--r-- | src/mod_wolfssl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mod_wolfssl.c b/src/mod_wolfssl.c index 651de057..6ddfaa46 100644 --- a/src/mod_wolfssl.c +++ b/src/mod_wolfssl.c @@ -1823,7 +1823,8 @@ mod_openssl_alpn_select_cb (SSL *ssl, const unsigned char **out, unsigned char * if (in[i] == 'h' && in[i+1] == '2') { if (!hctx->r->conf.h2proto) continue; proto = MOD_OPENSSL_ALPN_H2; - hctx->r->http_version = HTTP_VERSION_2; + if (hctx->r->handler_module == NULL)/*(e.g. not mod_sockproxy)*/ + hctx->r->http_version = HTTP_VERSION_2; break; } continue; |