Incorrect http redirect URL when using IPv6 literal host

I’m seeing an issue where using https://[2001:db8::1]/ style address gives an invalid url when it tries to send the user to /login . I’d call it a bug so created an GitHub issue BUG: Login redirect when connecting to ipv6 literal http host · Issue #20241 · librenms/librenms · GitHub but I was told it wasn’t the right place, so I assume then this is intended behavior?

Any chance there is a setting that I’m missing?

Or any chance to get an explanation to why this isn’t considered a bug?

It isn’t considered a bug because other people have been able to use IPv6 literals. This means it is likely a configuration issue specific to your install. Which needs to be individually troubleshot.

I just tested:

Any chance I can ask you to run curl -v https://[::1] -k ? Maybe this is only on https not http ?

May I ask if you have [::1] in APP_URL and/or base_url ?

Just verified to ::1 as well:

librenms@librenms:~$ curl https://[::1] -v -k 2>&1 | grep ::
* Connected to ::1 (::1) port 443
> Host: [::1]
< Location: https://%5B::1%5D/login
* Connection #0 to host ::1 left intact
        <meta http-equiv="refresh" content="0;url='https://%5B::1%5D/login'" />
        <title>Redirecting to https://%5B::1%5D/login</title>
        Redirecting to <a href="https://%5B::1%5D/login">https://%5B::1%5D/login</a>.
librenms@librenms:~$ curl http://[::1] -v -k 2>&1 | grep ::
* Connected to ::1 (::1) port 80
> Host: [::1]
< Location: https://[::1]/
* Connection #0 to host ::1 left intact

But this isn’t a real test either because in the http case it is nginx that does the redirect to https for me.
Removed the nginx redirect and seeing the same thing on http as well:

librenms@librenms curl http://[::1] -v -k 2>&1 | grep ::grep ::
* Connected to ::1 (::1) port 80
> Host: [::1]
< Location: http://%5B::1%5D/login
* Connection #0 to host ::1 left intact
<meta http-equiv="refresh" content="0;url='http://%5B::1%5D/login'" />
<title>Redirecting to http://%5B::1%5D/login</title>
Redirecting to <a href="http://%5B::1%5D/login">http://%5B::1%5D/login</a>.

I think this is an upstream issue: IPv6 URLs with square brackets are not supported by Laravel's routing system · Issue #46315 · laravel/framework · GitHub I’m still adamant about this being a bug that should be fixed, but I fully respect that it isn’t in LibreNMS.

And for context, I totally understand volunteers etc, same as in iPXE, don’t create an issue report unless it is verified it is a bug, I should have dug deeper and had more details…

Now I still want to know if it actually does work for others, and if it does what differs, but at least I have verified it is a bug, let’s not discuss where and who should fix it.

But from the responses I will no longer raise issues and potentially only do PRs once I have a fix.

Seems like we cannot fix your issue based on your referenced bugs.

One work around would be to use a hostname.