Re: [jetty-users] Custom bad message error page

2023-08-08 Thread Silvio Bierman via jetty-users
Hello Joakim, Thanks very much. That works like a charm. I did also call Server.setErrorHandler but the handler did not override badMessageError. Kind regards, Silvio On 08-08-2023 02:02, Joakim Erdfelt wrote: You can write your own custom ErrorHandler for these kinds of errors, but it

Re: [jetty-users] Custom bad message error page

2023-08-08 Thread Silvio Bierman via jetty-users
Hi Simone, Sorry for the obfuscation. I meant the error message that is returned when a request comes in that does not contain an SNI (we call sslContextFactory.setSniRequired(true)). That message contains the "Caused by:" fragment I posted. But I was able to solve the issue with the info

Re: [jetty-users] Custom bad message error page

2023-08-07 Thread Joakim Erdfelt via jetty-users
You can write your own custom ErrorHandler for these kinds of errors, but it has to be associated with the Server, not a ServletContextHandler. Remember, there is no Request object. Using the Server.setErrorHandler(ErrorHandler) is sufficient to set your custom error handler. Note that you will

Re: [jetty-users] Custom bad message error page

2023-08-07 Thread Joakim Erdfelt via jetty-users
The BadMessageException that occurs during HTTP parsing (before there is a Request object) is handled by ErrorHandler.badMessageError() See https://github.com/eclipse/jetty.project/blob/jetty-11.0.15/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java#L527 That sets the

Re: [jetty-users] Custom bad message error page

2023-08-07 Thread Simone Bordet via jetty-users
Hi, On Mon, Aug 7, 2023 at 4:49 PM Silvio Bierman wrote: > > Hello Simone, > > Thank you for the reply. We do not want to change the compliance, the > error flagging is correct and desired. It is just that some potential > user doing a pen-test on our system is objecting to the messages being >

Re: [jetty-users] Custom bad message error page

2023-08-07 Thread Silvio Bierman via jetty-users
Hello Simone, Thank you for the reply. We do not want to change the compliance, the error flagging is correct and desired. It is just that some potential user doing a pen-test on our system is objecting to the messages being generated. The SNI message contains "Caused by:

Re: [jetty-users] Custom bad message error page

2023-08-07 Thread Simone Bordet via jetty-users
Hi, On Mon, Aug 7, 2023 at 12:16 PM Silvio Bierman via jetty-users wrote: > > Hi, > > I run embedded Jetty 11.0.13. I have a single servlet instance and call > ServletContextHandler#setErrorHandler(customHandler) during initialization. > But whenever an invalid URL (like one containing empty