-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
www/caddy: v2.9.0 breaks proxying OPNSense Web GUI #4471
Comments
In that thread there is a solution that you can try. Open the advanced options in the handler and choose HTTP Version - HTTP 1.1 |
The weird part is that I cannot reproduce it. I have tested this with multiple OPNsense WebGUIs of different versions, and it always works for me. That means it cannot be a general issue for everybody, it must be something specific. |
For now I guess its an upstream issue or a browser issue, so it might be best to go to: I cannot own an upstream ticket since I cannot reproduce it in my environment. |
Yeah that works - straight away. I'm curious, when you tested this - was it simply does it load, or did you wait a bit? The issue doesn't manifest immediately - it takes a minute or two to kick in. |
Please tell me on which page you wait. When I look at the logs it seems like you wait on the Dashboard?
I just tested if it loads and I click around a bit, I didn't wait anywhere for too long. |
It's not specific to any page - but this is a fairly consistent approach for triggering it:
|
I still cannot replicate the issue:
There must be a difference in the OPNsense or Caddy setup of people that experience the issue (like you, someone on the forum this morning https://forum.opnsense.org/index.php?topic=45233.msg226083, and the others in the Caddy forum that did not use this plugin), and others that do not experience it (like me and others we do not know about.) For now there is not much I can do. Since you have this issue you could see if something can be found out with your logs if you open an issue upstream. |
according to this... its a tls issue... |
I got some more information here from a different user: https://www.reddit.com/r/opnsense/comments/1i36sq7/comment/m7m7rl0/?context=3 They used TLS TRUST Pool instead of tls insecure skip verify, like I suggest in the OPNsense documentation: https://docs.opnsense.org/manual/how-tos/caddy.html#reverse-proxy-the-opnsense-webgui |
I switched my setup from 'TLS Insecure Skip Verify' to use 'TLS Trust Pool' instead; however, I still get the 400 Bad Request error when I set the 'HTTP Version' back to default. It only connects succesfully after setting it to HTTP/1.1. |
@NG1973 Can you test if it happens if you specifically select HTTP/2.0 ? What is the exact error? Can you enable the Caddy debug logs and post the requests and the error here? |
I finally got the issue reproduced locally so I will try to hunt this down. |
Can anybody verify that it also stops from happening when HTTP/3 is deselected in General Settings (Only HTTP/1.1 and HTTP/2 selected) The handler should be default for this test with the default "HTTP/1.1, HTTP/2" selected. |
I enabled some debug logging in As soon as In RFC7231 it is stated:
This means that
This is controlled by the following setting in
This behavior will only happen when a browser (e.g. Chrome) uses h3 (HTTPS over QUIC) to communicate with Caddy. More explained here: |
Can confirm that this works |
@dcrdev Thank you for confirming. I have merged a PR that will disable HTTP/3 per default for people that update later or (re)install the plugin. Its not live yet but it will probably be in a new plugin revision soon. For now that seemed like the best option. |
FYI this setting is safe to change in lighttpd for lighttpd. lighttpd handles it properly. The reason the lighttpd default is to reject GET/HEAD with request body is RFC9110 warnings about potential avenues for abuse, as mholt notes in caddyserver/caddy#6678 (comment) If a HTTP/1.1 proxy vulnerable to request smuggling proxies requests to another proxy which translates HTTP/1.1 to HTTP/2 or to HTTP/3 when connecting to an origin server, this scenario might occur, and not only for HTTP/1.x requests to the origin server. If lighttpd is that origin server, the default in lighttpd is to reject GET/HEAD with request body, as a paranoid default, since GET/HEAD without request body is by far the most common historical behavior for GET/HEAD. lighttpd provides the configuration option to tell lighttpd to serve the GET/HEAD request, which may include processing the request body, or ignoring the request body, depending on the lighttpd handler. |
@gstrauss Thank you for the explanation. I was hesitent because Im not an expert regarding the lighttpd webserver. When I see an option thats not enabled by default, I imply that it has a reason (e.g. its a secure default). EDIT: I'll offer a PR in opnsense/core to enable this setting and see how the discussion goes. Maybe. |
Since this behavior has been hotfixed with a configuration change in the caddy plugin, I'll close this as solved. |
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Describe the bug
The update to caddy-v2.9.0 breaks proxying the OPNSense WebGUI - there are intermittent cases where Caddy returns a http 400. This has been reported by several others here https://caddy.community/t/access-to-opnsense-throws-a-400-bad-request-after-upgrading-caddy-from-2-8-4-to-2-9/29525
To Reproduce
Steps to reproduce the behaviour:
Add a handler pointing to OPNsense:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Relevant log files
Additional context
Environment
OPNsense 24.7.12-amd64
FreeBSD 14.1-RELEASE-p6
Browsers: Safari / Chrome
The text was updated successfully, but these errors were encountered: