diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 913a5bb3648..beb84c0fdc3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -197,7 +197,7 @@ jobs: # ------------------------------------------------------------------------- - name: HTTP/2 test suite config: --enable-mods-shared=reallyall --with-mpm=event --enable-mpms-shared=all - pkgs: curl python3-pytest nghttp2-client python3-cryptography python3-requests python3-multipart + pkgs: curl python3-pytest nghttp2-client python3-cryptography python3-requests python3-multipart python3-filelock python3-websockets env: | APR_VERSION=1.7.4 APU_VERSION=1.6.3 @@ -228,7 +228,7 @@ jobs: ### TODO: fix caching here. - name: MOD_TLS test suite config: --enable-mods-shared=reallyall --with-mpm=event --enable-mpms-shared=event - pkgs: curl python3-pytest nghttp2-client python3-cryptography python3-requests python3-multipart cargo cbindgen + pkgs: curl python3-pytest nghttp2-client python3-cryptography python3-requests python3-multipart python3-filelock python3-websockets cargo cbindgen env: | APR_VERSION=1.7.4 APU_VERSION=1.6.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index e27d6863014..869f72173f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,6 +497,7 @@ SET(mod_http2_extra_sources modules/http2/h2_request.c modules/http2/h2_session.c modules/http2/h2_stream.c modules/http2/h2_switch.c modules/http2/h2_util.c modules/http2/h2_workers.c + modules/http2/h2_ws.c ) SET(mod_ldap_extra_defines LDAP_DECLARE_EXPORT) SET(mod_ldap_extra_libs wldap32) @@ -966,7 +967,7 @@ IF(OPENSSL_FOUND) SET_TARGET_PROPERTIES(abs PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}") DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ab/SSL program") SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=abs.exe ${EXTRA_COMPILE_FLAGS}") - TARGET_LINK_LIBRARIES(abs ${EXTRA_LIBS} ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) + TARGET_LINK_LIBRARIES(abs ${EXTRA_LIBS} ${APR_LIBRARIES} ${OPENSSL_LIBRARIES} Ws2_32.lib) ENDIF() GET_PROPERTY(tmp_includes TARGET ab PROPERTY INCLUDE_DIRECTORIES) diff --git a/changes-entries/h2_flush_fix.txt b/changes-entries/h2_flush_fix.txt new file mode 100644 index 00000000000..b44a3319f67 --- /dev/null +++ b/changes-entries/h2_flush_fix.txt @@ -0,0 +1,4 @@ + *) mod_http2: fixed a bug in flushing pending data on an already closed + connection that could lead to a busy loop, preventing the HTTP/2 session + to close down successfully. Fixed PR 66624. + [Stefan Eissing] diff --git a/changes-entries/h2_pr66646.txt b/changes-entries/h2_pr66646.txt new file mode 100644 index 00000000000..6bf23cfe47b --- /dev/null +++ b/changes-entries/h2_pr66646.txt @@ -0,0 +1,6 @@ + *) mod_http2: fixed a bug that could lead to a crash in main connection + output handling. This occured only when the last request on a HTTP/2 + connection had been processed and the session decided to shut down. + This could lead to an attempt to send a final GOAWAY while the previous + write was still in progress. See PR 66646. + [Stefan Eissing] diff --git a/changes-entries/h2_proxyrequests.txt b/changes-entries/h2_proxyrequests.txt new file mode 100644 index 00000000000..199d2c93b03 --- /dev/null +++ b/changes-entries/h2_proxyrequests.txt @@ -0,0 +1,6 @@ + *) mod_http2: new directive `H2ProxyRequests on|off` to enable handling + of HTTP/2 requests in a forward proxy configuration. + General forward proxying is enabled via `ProxyRequests`. If the + HTTP/2 protocol is also enabled for such a server/host, this new + directive is needed in addition. + [Stefan Eissing] diff --git a/changes-entries/h2_websockets.txt b/changes-entries/h2_websockets.txt new file mode 100644 index 00000000000..0f2bc715da0 --- /dev/null +++ b/changes-entries/h2_websockets.txt @@ -0,0 +1,10 @@ + *) mod_http2: added support for bootstrapping WebSockets via HTTP/2, as + described in RFC 8441. A new directive 'H2WebSockets on|off' has been + added. The feature is by default not enabled. + As also discussed in the manual, this feature should work for setups + using "ProxyPass backend-url upgrade=websocket" without further changes. + Special server modules for WebSockets will have to be adapted, + most likely, as the handling if IO events is different with HTTP/2. + HTTP/2 WebSockets are supported on platforms with native pipes. This + excludes Windows. + [Stefan Eissing] \ No newline at end of file diff --git a/changes-entries/pr66672.txt b/changes-entries/pr66672.txt new file mode 100644 index 00000000000..f36897bb0d2 --- /dev/null +++ b/changes-entries/pr66672.txt @@ -0,0 +1,3 @@ + *) mod_rewrite: Fix a recent regression where a rule with both a trailing + '?' and the [QSA] flag did not have the query appended. PR66672 + Frank Meier diff --git a/configure.in b/configure.in index daaae7d2004..719f8ac5c30 100644 --- a/configure.in +++ b/configure.in @@ -999,6 +999,7 @@ APACHE_FAST_OUTPUT(support/Makefile) if test -d ./test; then APACHE_FAST_OUTPUT(test/Makefile) AC_CONFIG_FILES([test/pyhttpd/config.ini]) + APACHE_FAST_OUTPUT(test/clients/Makefile) fi dnl ## Finalize the variables diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index e73dda0faec..ab2acdaf2df 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10456 +10473 diff --git a/docs/manual/mod/directives.html.fr.utf8 b/docs/manual/mod/directives.html.fr.utf8 index 605749905aa..8e261dcacf2 100644 --- a/docs/manual/mod/directives.html.fr.utf8 +++ b/docs/manual/mod/directives.html.fr.utf8 @@ -347,6 +347,7 @@
  • H2ModernTLSOnly
  • H2OutputBuffering
  • H2Padding
  • +
  • H2ProxyRequests
  • H2Push
  • H2PushDiarySize
  • H2PushPriority
  • @@ -357,6 +358,7 @@
  • H2TLSCoolDownSecs
  • H2TLSWarmUpSize
  • H2Upgrade
  • +
  • H2WebSockets
  • H2WindowSize
  • Header
  • HeaderName
  • diff --git a/docs/manual/mod/mod_http2.html.fr.utf8 b/docs/manual/mod/mod_http2.html.fr.utf8 index a6681d7d5ca..eb120a6c320 100644 --- a/docs/manual/mod/mod_http2.html.fr.utf8 +++ b/docs/manual/mod/mod_http2.html.fr.utf8 @@ -94,6 +94,7 @@
  • H2ModernTLSOnly
  • H2OutputBuffering
  • H2Padding
  • +
  • H2ProxyRequests
  • H2Push
  • H2PushDiarySize
  • H2PushPriority
  • @@ -104,6 +105,7 @@
  • H2TLSCoolDownSecs
  • H2TLSWarmUpSize
  • H2Upgrade
  • +
  • H2WebSockets
  • H2WindowSize
  • Traitement des bugs

    Voir aussi

    @@ -622,6 +624,30 @@ provenir d'un client dont l'implémentation comporte des erreurs.

    + +
    top
    +

    Directive H2ProxyRequests

    + + + + + + + + +
    Description:Active/Désactive les requêtes sous mandat direct via HTTP/2
    Syntaxe:H2ProxyRequests on|off
    Défaut:H2ProxyRequests off
    Contexte:configuration globale, serveur virtuel
    Statut:Extension
    Module:mod_http2
    Compatibilité:Disponible à partir de la version 2.5.1 du serveur HTTP + Apache
    +

    + La directive H2ProxyRequests permet + d'activer ou de désactiver la gestion des requêtes HTTP/2 dans + un contexte de mandat direct. +

    + Similaire à ProxyRequests, + cette directive déclenche le traitement nécessaire des requêtes + lorsque HTTP/2 est activé dans un contexte de mandat direct. +

    +

    +
    top

    Directive H2Push

    @@ -1122,6 +1148,46 @@ H2PushPriority text/css interleaved # poids de 256 par défaut

    Exemple

    H2Upgrade on
    +
    +
    top
    +

    Directive H2WebSockets

    + + + + + + + + +
    Description:Active/désactive les WebSockets via HTTP/2
    Syntaxe:H2WebSockets on|off
    Défaut:H2WebSockets off
    Contexte:configuration globale, serveur virtuel
    Statut:Extension
    Module:mod_http2
    Compatibilité:Disponible à partir de la version 2.5.1 du serveur HTTP + Apache
    +

    + La directive H2WebSockets permet + d'activer ou de désactiver l'amorçage des WebSockets via le + protocole HTTP/2. Cette extension du protocole est définie dans + la RFC 8441. +

    + Ces requêtes sont similaires à CONNECT, mais elles possèdent + l'en-tête supplémentaire ':protocol'. Elles sont transformées au + sein du module en leurs équivalents HTTP/1.1 avant d'être + soumises au traitement interne. +

    + Cela signifie que les WebSockets HTTP/2 peuvent être utilisés + dans le cadre d'une directive ProxyPass avec le paramètre + 'upgrade=websocket' sans autres modifications. +

    + Pour les modules tiers qui gèrent les WebSockets directement + dans le serveur, l'amorçage du protocole lui-même fonctionnera + aussi. Dans le cas de HTTP/2 cependant, le transfert de données + nécessite une prise en charge supplémentaire. Le WebSocket + négocié sera incapable d'utiliser le socket de connexion du + client pour examiner les évènements d'entrée/sortie concernés. +

    + Cette fonctionnalité étant susceptible de briser la + compatibilité ascendante pour de tels modules tiers, elle n'est + pas activée par défaut. +

    +
    top

    Directive H2WindowSize

    diff --git a/docs/manual/mod/mod_http2.xml b/docs/manual/mod/mod_http2.xml index 926bb1ca5f2..e769a759146 100644 --- a/docs/manual/mod/mod_http2.xml +++ b/docs/manual/mod/mod_http2.xml @@ -1082,4 +1082,66 @@ H2EarlyHint Link "</my.css>;rel=preload;as=style" + + H2WebSockets + En-/Disable WebSockets via HTTP/2 + H2WebSockets on|off + H2WebSockets off + + server config + virtual host + + Available in version 2.5.1 and later. + + +

    + Use H2WebSockets to enable or disable + bootstrapping of WebSockets via the HTTP/2 protocol. This + protocol extension is defined in RFC 8441. +

    + Such requests come as a CONNECT with an extra ':protocol' + header. Such requests are transformed inside the module to + their HTTP/1.1 equivalents before passing it to internal + processing. +

    + This means that HTTP/2 WebSockets can be used for a + ProxyPass with + 'upgrade=websocket' parameter without further changes. +

    + For (3rd party) modules that handle WebSockets directly in the + server, the protocol bootstrapping itself will also work. However + the transfer of data does require extra support in case of HTTP/2. + The negotiated WebSocket will not be able to use the client connection + socket for polling IO related events. +

    + Because enabling this feature might break backward compatibility + for such 3rd party modules, it is not enabled by default. +

    +
    +
    + + + H2ProxyRequests + En-/Disable forward proxy requests via HTTP/2 + H2ProxyRequests on|off + H2ProxyRequests off + + server config + virtual host + + Available in version 2.5.1 and later. + + +

    + Use H2ProxyRequests to enable or disable + handling of HTTP/2 requests in a forward proxy configuration. +

    + Similar to ProxyRequests, this + triggers the needed treatment of requests when HTTP/2 is enabled + in a forward proxy configuration. Both directive should be enabled. +

    +

    +
    +
    + diff --git a/docs/manual/mod/mod_http2.xml.fr b/docs/manual/mod/mod_http2.xml.fr index bb912af9f96..e6c70267e27 100644 --- a/docs/manual/mod/mod_http2.xml.fr +++ b/docs/manual/mod/mod_http2.xml.fr @@ -1,7 +1,7 @@ - + + @@ -1436,7 +1436,7 @@ ProxyPass "/mirror/foo/i" "!" timeout ProxyTimeout - Délai d'attente de la connexion en secondes. Le nombre de + Délai d'attente du socket en secondes. Le nombre de secondes pendant lesquelles Apache httpd attend l'envoi de données vers le serveur d'arrière-plan. Utilise la syntaxe time-interval. diff --git a/docs/manual/mod/mod_proxy.xml.ja b/docs/manual/mod/mod_proxy.xml.ja index 8626f4597ae..070a3448f51 100644 --- a/docs/manual/mod/mod_proxy.xml.ja +++ b/docs/manual/mod/mod_proxy.xml.ja @@ -1,7 +1,7 @@ - +