From 5fe48ee9fb5a04757f09ab1704ef391138e033b1 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Sun, 15 Dec 2024 15:07:12 +0000 Subject: [PATCH] Silently ignore rather than warn for known, unsupported HTTP/2 settings --- java/org/apache/coyote/http2/ConnectionSettingsBase.java | 4 ++++ java/org/apache/coyote/http2/Setting.java | 8 ++++++++ webapps/docs/changelog.xml | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java b/java/org/apache/coyote/http2/ConnectionSettingsBase.java index 64d5cf4e688b..749fac5cff51 100644 --- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java +++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java @@ -93,6 +93,10 @@ final void set(Setting setting, long value) throws T { case NO_RFC7540_PRIORITIES: validateNoRfc7540Priorities(value); break; + case ENABLE_CONNECT_PROTOCOL: + case TLS_RENEG_PERMITTED: + // Not supported. Ignore it. + return; case UNKNOWN: // Unrecognised. Ignore it. return; diff --git a/java/org/apache/coyote/http2/Setting.java b/java/org/apache/coyote/http2/Setting.java index bf702024b576..cd86c09296a6 100644 --- a/java/org/apache/coyote/http2/Setting.java +++ b/java/org/apache/coyote/http2/Setting.java @@ -23,7 +23,9 @@ enum Setting { INITIAL_WINDOW_SIZE(4), MAX_FRAME_SIZE(5), MAX_HEADER_LIST_SIZE(6), + ENABLE_CONNECT_PROTOCOL(8), NO_RFC7540_PRIORITIES(9), + TLS_RENEG_PERMITTED(10), UNKNOWN(Integer.MAX_VALUE); private final int id; @@ -61,9 +63,15 @@ static Setting valueOf(int i) { case 6: { return MAX_HEADER_LIST_SIZE; } + case 8: { + return ENABLE_CONNECT_PROTOCOL; + } case 9: { return NO_RFC7540_PRIORITIES; } + case 10: { + return TLS_RENEG_PERMITTED; + } default: { return UNKNOWN; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 3585743864d9..03ee5c2372fb 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -118,6 +118,14 @@ + + + + Don't log warnings for registered HTTP/2 settings that Tomcat does not + support. These settings are now silently ignored. (markt) + + +