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
{{ message }}
Repository navigation
ios 9.x - ipv6 Test not work.. (CURLE_COULDNT_CONNECT) #594
Are you running a program that works fine otherwise on other platforms (like native mac) ?
CURLE_COULDNT_CONNECT means libcurl failed to establish a TCP connection to the remote host (and port). Are you sure you're supposed to be able to without using a proxy or any other similar means? Can you telnet to that host + port from the same machine that curl fails to work on?
Can you generate a full VERBOSE-enabled log for when you do this and show us?
I don't think we have many iPhone users among or developers so I think you're left a bit on your own to further debug this. But me knowingly, it should just work fine on iOS as well.
Have you gotten this to work with any other libcurl version?
if ipv4 works and ipv6 doesn't, that sounds more like an OS issue then anything else to me. libcurl really doesn't do much difference between IP versions and CURLE_COULDNT_CONNECT means that connect() returned a failure. What else can we do?
The CURL_VERSION_IPV6 bit is set if libcurl "supports IPv6". With that set, it can resolve host names to IPv6 addresses. Without it, it can't so it can't do IPv6 at all. So if your libcurl is built without IPv6 support, the problem is not exactly what you've said (since you can't use IPv6) and again it would've showed in the VERBOSE log you have not shown us.
You need a libcurl built to support IPv6 in order to use IPv6.
(1) yes, "normal case" is using IPv4 (ios simulator)
(2) i used cocos2s-x's curl lib (ios device is not enabled)
(3) my build lib - ios device is not enabled setting , why ??? i just default build. (from v0.7.40)
i386 , x86_64 is "checking whether to enable IPv6... yes"
armv7 , arm64 is "checking whether to enable IPv6... no"
When it says 'no', load the config.log file and search for the ipv6 test and you'll see what it tried to do and what failed. I think the problem is that when you cross-compile, that test doesn't really work. I would probably recommend you to manually edit lib/curl_config.h after configure has run and enable IPv6 there.
@masteage Is you app approved after change? I use https://github.com/sinofool/build-libcurl-ios to build curl with openssl, it can pass the DNS64/NAT64 local settings. But it's still rejected on Apple review ipv6 environment.
Under IPV6 environment, curl returns ok while running on simulators, but curl returns error while running on real iPhone device.I added the following code in my program to check IPV6 features:
curl_version_info_data *d=curl_version_info(CURLVERSION_NOW);
printf("feature=%04x, CURL_VERSION_IPV6=%d\n ",d->features, CURL_VERSION_IPV6);
The results shows the followings:
(1) CURL_VERSION_IPV6=1 under both emulators and real devices
(2) the lowest bit of features = 1 under emulators
(3) the lowest bit of features = 0 under real devices
according to ./lib/version.c if Enable_IPV6, the lowest bit(CURL_VERSION_IPV6) should be 1. but du to some faults, it is set to 0 under armv7 , arm64.
(1) CURL_VERSION_IPV6=1 under both emulators and real devices
(2) the lowest bit of features = 1 under emulators
(3) the lowest bit of features = 0 under real devices
That feature is set at built time, so if you build libcurl with IPv6 support it will always show that bit in features. Also please don't piggyback on this issue. If you have libcurl questions ask them on the mailing list, or if you have a bug you can file it as a separate issue. I'm 99% sure that's not a bug though, very likely you are running some different version of libcurl not built with IPv6 support.
Activity
bagder commentedon Jan 8, 2016
Are you running a program that works fine otherwise on other platforms (like native mac) ?
CURLE_COULDNT_CONNECT means libcurl failed to establish a TCP connection to the remote host (and port). Are you sure you're supposed to be able to without using a proxy or any other similar means? Can you telnet to that host + port from the same machine that curl fails to work on?
Can you generate a full VERBOSE-enabled log for when you do this and show us?
I don't think we have many iPhone users among or developers so I think you're left a bit on your own to further debug this. But me knowingly, it should just work fine on iOS as well.
Have you gotten this to work with any other libcurl version?
masteage commentedon Jan 8, 2016
(1) normal network is no problem (live ios (iphone,ipad..) project)
(2) test network setting
(3) version
bagder commentedon Jan 8, 2016
if ipv4 works and ipv6 doesn't, that sounds more like an OS issue then anything else to me. libcurl really doesn't do much difference between IP versions and CURLE_COULDNT_CONNECT means that connect() returned a failure. What else can we do?
masteage commentedon Jan 8, 2016
thanks, your answer.
i will more test ... (other network , os, device)
masteage commentedon Jan 8, 2016
(1) how to check ipv6 able?
(2) if ipv6 check is “curl_version_info->features & CURL_VERSION_IPV6” ,
this value when change? [lib time change(setting) or runtime change?]
(3) hot to set ipv6 able ?
(etc) curl_version_info->features value (ipv6 not work state)
(my code)
curl_easy_setopt(curl, CURLOPT_URL, url);
header = curl_slist_append( header , "Content-Type: text/html");
curl_easy_setopt( curl , CURLOPT_HTTPHEADER , header );
curl_easy_setopt( curl , CURLOPT_WRITEFUNCTION, func);
curl_easy_setopt( curl , CURLOPT_WRITEHEADER, strRecvHeader);
curl_easy_setopt( curl , CURLOPT_WRITEDATA, strRecvBody);
curl_easy_setopt( curl , CURLOPT_POSTFIELDS , strData.c_str() );
curl_easy_setopt( curl , CURLOPT_POST , true );
curl_easy_setopt( curl, CURLOPT_TIMEOUT, 10);
res = curl_easy_perform(curl);
bagder commentedon Jan 8, 2016
The
CURL_VERSION_IPV6bit is set if libcurl "supports IPv6". With that set, it can resolve host names to IPv6 addresses. Without it, it can't so it can't do IPv6 at all. So if your libcurl is built without IPv6 support, the problem is not exactly what you've said (since you can't use IPv6) and again it would've showed in the VERBOSE log you have not shown us.You need a libcurl built to support IPv6 in order to use IPv6.
bagder commentedon Jan 11, 2016
A libcurl without IPv6 support cannot speak IPv6.
masteage commentedon Jan 12, 2016
(1) ios device is not VERBOSE log. (simulator is log has)
(2) simulator log (normal case)
bagder commentedon Jan 12, 2016
But that "normal case" shows it only using IPv4... An IPv6 capable curl would be more likely to say this:
masteage commentedon Jan 12, 2016
(1) yes, "normal case" is using IPv4 (ios simulator)
(2) i used cocos2s-x's curl lib (ios device is not enabled)
(3) my build lib - ios device is not enabled setting , why ??? i just default build. (from v0.7.40)
bagder commentedon Jan 12, 2016
When it says 'no', load the config.log file and search for the ipv6 test and you'll see what it tried to do and what failed. I think the problem is that when you cross-compile, that test doesn't really work. I would probably recommend you to manually edit
lib/curl_config.hafter configure has run and enable IPv6 there.bagder commentedon Jan 12, 2016
I will actually switch the default for that for the next curl version.
configure: assume IPv6 works when cross-compiled
masteage commentedon Jan 12, 2016
thanks, your answer.
my default setting is bug.
add "--enable-ipv6" is solution.
and, change default setting thanks.
flyingsky commentedon Aug 20, 2016
@masteage Is you app approved after change? I use https://github.com/sinofool/build-libcurl-ios to build curl with openssl, it can pass the DNS64/NAT64 local settings. But it's still rejected on Apple review ipv6 environment.
SpringMT commentedon Sep 2, 2016
@flyingsky Is Apple review still rejected?
reasten commentedon Feb 8, 2017
Under IPV6 environment, curl returns ok while running on simulators, but curl returns error while running on real iPhone device.I added the following code in my program to check IPV6 features:
curl_version_info_data *d=curl_version_info(CURLVERSION_NOW);
printf("feature=%04x, CURL_VERSION_IPV6=%d\n ",d->features, CURL_VERSION_IPV6);
The results shows the followings:
(1) CURL_VERSION_IPV6=1 under both emulators and real devices
(2) the lowest bit of features = 1 under emulators
(3) the lowest bit of features = 0 under real devices
according to ./lib/version.c if Enable_IPV6, the lowest bit(CURL_VERSION_IPV6) should be 1. but du to some faults, it is set to 0 under armv7 , arm64.
jay commentedon Feb 8, 2017
That feature is set at built time, so if you build libcurl with IPv6 support it will always show that bit in features. Also please don't piggyback on this issue. If you have libcurl questions ask them on the mailing list, or if you have a bug you can file it as a separate issue. I'm 99% sure that's not a bug though, very likely you are running some different version of libcurl not built with IPv6 support.