XJetty 431 Request Header Fields Too Large - how to set server.max-http-request-header-size?

Hello,

we started to implement Kerberos SSO and with some users we run into problems with the http header size, probably because of to many group memberships.

# cat /var/log/xwiki/2024_04_18.jetty.log
[…]
2024-04-18 16:42:27.180:WARN :oejh.HttpParser:qtp1263877414-19: Header is too large 8193>8192

I found some general solution for Jetty with the parameters:
server.max-http-request-header-size=32768
server.max-http-response-header-size=32768

But I had not found a way to activate these parameters in the XJetty start_xwiki.sh Sometimes these parameters are written as -Dserver.max-http-request-header-size=32768 sometimes without the capital D in front.
I tried setting them as XWIKI_OPTS and JETTY_OPTS but had no luck so far.

Can somebody tell me how I activate the larger header properties for XJetty?
The installation is an 16.2 YJetty Debian Package.

Thank you and best regards

Ok I have found an solution but this one is probably “dirty” and will definitely get overwritten with the next update:

  1. nano /usr/lib/xwiki-jetty/jetty/etc/jetty.xml
  2. Inside the block for <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> the following must be added.
      <Set name="requestHeaderSize">32768</Set>
  1. systemctl restart xwiki
    Now the Jetty handles larger header sizes which can be important if you use SSO and kerberos with many Active Directory group memberships.

Is there an better way to set this inside the start_xwiki.sh like setting proxy settings?