-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Using IPV6 host in CURLOPT_RESOLVE or --resolve results in a malformed/illegal address error #16357
Comments
I suppose we never properly considered using this option to replace IP addresses. |
I don't know why anyone would do that |
@rmg-x maybe --connect-to can do what you want? it matches by string so the ip address would have to match exactly as in the url
|
This was found while working on the Ladybird browser project which uses libcurl in the backend to handle requests. It has its own DNS resolver capability so that, in the future, users have full control over that process rather than delegating to an underlying/system resolver. It's slightly odd but on each request, Given the fact that IPV4 addresses work correctly in this case, I'd expect the IPV6 equivalent to as well. |
Sure, for a name that gets resolved such reasoning makes sense but for a numerical IP address, it really does not. Still, a bug. |
This also applies to --resolve of course. Fixes #16357 Reported-by: rmg-x on github
Sorry for being unclear, I was just explaining how it was found. I definitely don't think this is a normal or common use case 😅 I appreciate the quick responses and PR to address this! |
This also applies to --resolve of course. Fixes #16357 Reported-by: rmg-x on github
I did this
On the command line:
which all resulted in the following error:
With libcurl (and the same combinations with square brackets above):
results in:
I expected the following
The IPV6 host section to be parsed correctly since
1.1.1.1:443:1.1.1.1
works as expected.curl/libcurl version
curl 7.81.0
libcurl 7.81.0
operating system
Linux desktop 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: