Text of github.com › curl › curl › issues › 2087 as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

--resolve doesn't work with IPv6 addresses in bracket notation · Issue #2087 · curl/curl · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert --resolve doesn't work with IPv6 addresses in bracket notation #2087 New issue Copy link New issue Copy link Closed Closed --resolve doesn't work with IPv6 addresses in bracket notation #2087 Copy link Description demonbane opened on Nov 16, 2017 Issue body actions I did this (host/ip are intentionally obfuscated) curl -v --resolve 'myhost.domain.com:443:[dead:beef:1234:5678:8765:4321:feed:daed]' https://myhost.domain.com I expected the following For myhost.domain.com to resolve to [dead:beef:1234:5678:8765:4321:feed:daed] , but what I got was: curl -v --resolve 'myhost.domain.com:443:dead:beef:1234:5678:8765:4321:feeb:daed' https://myhost.domain.com * Address in 'myhost.domain.com:443:[dead:beef:1234:5678:8765:4321:feed:daed]' found illegal!

If I specify the IPv6 address incorrectly , that is without the brackets, then it works as expected: curl -v --resolve 'myhost.domain.com:443:dead:beef:1234:5678:8765:4321:feeb:daed' https://myhost.domain.com * Added myhost.domain.com:443:dead:beef:1234:5678:8765:4321:feeb:daed to DNS cache * Rebuilt URL to: https://myhost.domain.com/ * Hostname myhost.domain.com was found in DNS cache * Trying dead:beef:1234:5678:8765:4321:feeb:daed... curl/libcurl version curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3 Release-Date: 2017-08-14 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL operating system $ lsb_release -a No LSB modules are available.

Distributor ID: Ubuntu Description: Ubuntu 17.10 Release: 17.10 Codename: artful Activity bagder commented on Nov 16, 2017 bagder on Nov 16, 2017 Member More actions An IPv6 address is not generally written with brackets outside of URLs, see RFC 5952 "A Recommendation for IPv6 Address Text Representation" . Can you explain why you think you should do it in --resolve ? I also don't see it mentioned in the documentation. demonbane commented on Nov 16, 2017 demonbane on Nov 16, 2017 Author More actions There are three reasons I thought it should be used with brackets in --resolve : The only example of an IPv6 URL used in the man page lists it as http://[fe80::3%25eth0]/ , so it seemed logical that the brackets would be expected and handled properly The documentation for --resolve shows <host:port:address> .

Since an IPv6 address contains the colon ( : ) character, it seemed logical that including it without some sort of separator character would be incorrect. When I couldn't get --resolve to work, I tried using --connect-to instead, again with the bracket notation, and it worked just fine: curl -v --connect-to 'myhost.domain.com:443:[dead:beef:1234:5678:8765:4321:feeb:daed]:443' https://myhost.domain.com * Rebuilt URL to: https://myhost.domain.com/ * Connecting to hostname: dead:beef:1234:5678:8765:4321:feeb:daed * Connecting to port: 443 * Trying dead:beef:1234:5678:8765:4321:feeb:daed... bagder added a commit that references this issue on Nov 17, 2017 resolve: allow IP address within [] brackets This issue will close once commit 89ed1e8 is merged into the 'master' branch.

89ed1e8 bagder commented on Nov 17, 2017 bagder on Nov 17, 2017 Member More actions You convinced me. Thanks! PR for adding support for brackets is in #2091 ! bagder commented on Nov 17, 2017 bagder on Nov 17, 2017 Member More actions Thanks! bagder closed this as completed in 715f1f5 on Nov 17, 2017 lock locked as resolved and limited conversation to collaborators on May 6, 2018 Sign up for free to join this conversation on GitHub.

Already have an account? Sign in to comment Metadata Metadata Assignees No one assigned Labels No labels No labels Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.