Skip to content
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

CURLOPT_PROXY: IPv6 address without port #415

Closed
MarcelRaad opened this issue Sep 7, 2015 · 2 comments
Closed

CURLOPT_PROXY: IPv6 address without port #415

MarcelRaad opened this issue Sep 7, 2015 · 2 comments
Assignees

Comments

@MarcelRaad
Copy link
Member

The following code doesn't work:

curl_easy_setopt(easy_handle, CURLOPT_PROXY, "2a00:fac0:a000::7:13");
curl_easy_setopt(easy_handle, CURLOPT_PROXYPORT, 8080L);

url.c:parse_proxy sets the proxy name to "2a00" and overrides the port with 0, as it tries to parse "fac0:a000::7:13" as a port number. Is this a bug or expected behavior?

Unfortunately the documentation at http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html doesn't mention if IPv6 addresses have to be in square brackets even if they don't contain a port number or a scheme. If so, probably the documentation should reflect that and parse_proxy should return an error if the port string is invalid.

@bagder bagder self-assigned this Sep 8, 2015
@bagder
Copy link
Member

bagder commented Sep 8, 2015

Thanks! I completely agree. I have a fix that makes the parser stricter and adds the bracket requirement to the man page, will push in a second.

@bagder bagder closed this as completed in 87e533a Sep 8, 2015
@MarcelRaad
Copy link
Member Author

Great, thank you!

jgsogo pushed a commit to jgsogo/curl that referenced this issue Oct 19, 2015
If the port number in the proxy string ended weirdly or the number is
too large, skip it. Mostly as a means to bail out early if a "bare" IPv6
numerical address is used without enclosing brackets.

Also mention the bracket requirement for IPv6 numerical addresses to the
man page for CURLOPT_PROXY.

Closes curl#415

Reported-by: Marcel Raad
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants