curl-container icon indicating copy to clipboard operation
curl-container copied to clipboard

Does not work with IPv6 only pages

Open tmaier opened this issue 1 year ago • 1 comments

I ran into a connectivity issue and was able to understand it with http://dual.tlund.se

When I run the following locally on my computer: (expected behaviour)

$ curl -v -I http://ipv6.tlund.se/
* Host ipv6.tlund.se:80 was resolved.
* IPv6: 2a00:801:f::195
* IPv4: (none)
*   Trying [2a00:801:f::195]:80...
* Connected to ipv6.tlund.se (2a00:801:f::195) port 80
> HEAD / HTTP/1.1
> Host: ipv6.tlund.se
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 30 Jul 2024 07:31:19 GMT
Date: Tue, 30 Jul 2024 07:31:19 GMT
< Server: Apache
Server: Apache
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8

<
* Connection #0 to host ipv6.tlund.se left intact

When I run it with curlimages/curl:latest:

$ docker container run --rm -it curlimages/curl:latest -v -I http://ipv6.tlund.se/
* Host ipv6.tlund.se:80 was resolved.
* IPv6: 2a00:801:f::195
* IPv4: (none)
*   Trying [2a00:801:f::195]:80...
* Immediate connect fail for 2a00:801:f::195: Network unreachable
* Failed to connect to ipv6.tlund.se port 80 after 5 ms: Could not connect to server
* closing connection #0
curl: (7) Failed to connect to ipv6.tlund.se port 80 after 5 ms: Could not connect to server

tmaier avatar Jul 30 '24 07:07 tmaier

trying to repro

podman run --rm -it curlimages/curl:8.9.0 -v -I http://ipv6.tlund.se/

  • Could not resolve host: ipv6.tlund.se
  • shutting down connection #0 curl: (6) Could not resolve host: ipv6.tlund.se

xquery avatar Jul 30 '24 08:07 xquery

Futher digging shows that this should be expected, since Docker does not support IPv6 by default.

See https://docs.docker.com/engine/daemon/ipv6/ and https://docs.podman.io/en/v4.4/markdown/podman-network-create.1.html#ipv6

tmaier avatar Aug 27 '24 07:08 tmaier

thx for digging in - closing this for now

xquery avatar Aug 29 '24 08:08 xquery