Re: CURLOPT_IPRESOLVE difference between 8.19.0 and 8.20.0

Stefan Eissing via curl-library <[email protected]> Sun, 3 May 2026 12:26:47 +0200
Newsgroups gmane.comp.web.curl.library
Message-ID <[email protected]>

> Am 03.05.2026 um 11:07 schrieb Jicea via curl-library <[email protected]>:
> 
> Hi all, 
> 
> I've noticed a different behaviour between 8.19.0 and 8.20.0 regarding CURLOPT_IPRESOLVE
> With a local sample that only listening on "::1" (IPv6 localhost), using --ipv4 / CURL_IPRESOLVE_V4 :
> 
> - Error with 8.19.0:
> 
> $ curl-8.19.0/bin/curl --ipv4 -v 'http://[::1]:8004/hello'
> * Could not resolve host: ::1
> * Store negative name resolve for ::1:8004
> * shutting down connection #0
> 
> - OK with 8.20.0:
> 
> $ curl-8.20.0/bin/curl --ipv4 -v 'http://[::1]:8004/hello'
> *   Trying [::1]:8004...
> * Established connection to ::1 (::1 port 8004) from ::1 port 54551 
> * using HTTP/1.x
>> GET /hello HTTP/1.1
>> Host: [::1]:8004
>> User-Agent: curl/8.20.0
>> Accept: */*
>> 
> * Request completely sent off
> < HTTP/1.1 200 OK
> < Content-Length: 12
> < Content-Type: text/html; charset=utf-8
> < Date: Sun, 03 May 2026 08:51:56 GMT
> < Server: Flask Server
> < Via: waitress
> < 
> * Connection #0 to host ::1:8004 left intact
> Hello World!%       
> 
> I wonder if this change is intentional or not, the behaviour of curl previous versions seems reasonable to me (error with only-IPv6 addresses when using --ipv4).
> Tests have been made on macOS and ArchLinux.

Yes, this is intentional and originated from https://github.com/curl/curl/issues/21146, where our solution is to treat literal ip addresses as "what the user asked for", overriding the CURLOPT_IPRESOLVE in such cases.

While the issue was about proxy connections, we wanted a solution that applies to all hostname/address resolutions equally.

Kind regards,
Stefan

> 
> Thanks, 
> 
> Jean-Christophe
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ____________________________________________________________________________________________________________
> Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
> 
> This message and its attachments may contain confidential or privileged information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
> Thank you.
> -- 
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette:   https://curl.se/mail/etiquette.html

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html