I did this
On the command line:
curl -v --resolve "2606:4700:4700::1111:443:2606:4700:4700::1111" https://[2606:4700:4700::1111]
curl -v --resolve "2606:4700:4700::1111:443:[2606:4700:4700::1111]" https://[2606:4700:4700::1111]
curl -v --resolve "[2606:4700:4700::1111]:443:2606:4700:4700::1111" https://[2606:4700:4700::1111]
curl -v --resolve "[2606:4700:4700::1111]:443:[2606:4700:4700::1111]" https://[2606:4700:4700::1111]
which all resulted in the following error:
* Resolve address '4700::1111:443:[2606:4700:4700::1111]' found illegal!
* Couldn't parse CURLOPT_RESOLVE entry '2606:4700:4700::1111:443:[2606:4700:4700::1111]'!
curl: (49) Couldn't parse CURLOPT_RESOLVE entry '2606:4700:4700::1111:443:[2606:4700:4700::1111]'!
With libcurl (and the same combinations with square brackets above):
#include <curl/curl.h>
#include <stdio.h>
int main(void) {
CURL *curl = curl_easy_init();
struct curl_slist *host = curl_slist_append(NULL, "2606:4700:4700::1111:443:2606:4700:4700::1111");
curl_version_info_data *version_data = curl_version_info(CURLVERSION_NOW);
printf("libcurl version: %s\n", version_data->version);
if (curl) {
curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
curl_easy_setopt(curl, CURLOPT_URL, "https://[2606:4700:4700::1111]");
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
printf("error: %s", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
}
curl_slist_free_all(host);
}
results in:
libcurl version: 7.81.0
error: Malformed option provided in a setopt
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
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.1works 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