Page 1 of 1

I can download using wget in linux but cUrl fails to https

Posted: 9. Jul 2012, 16:00
by MarceloCastro
Hello.

I'm very confused about this.
- I can navigate using http and https under firefox (default configuration nothing changed)
- virtualbox on windows in network adapter is "NAT" (default configuration, nothing changed)
- I can download using wget in linux but curl fails to https

Need help! thanks...
:mrgreen:


I have:
virtualbox 4.1.18 r78361
host: windows xp sp3 (32 bits)
client: linux ubuntu desktop 11.10 (32 bits)

I'm trying to update with android repo with this command , but it fails.
marcelo@marcelo:~$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:02:30 --:--:-- 0curl: (7) Failed to connect to 2001:4860:800a::5d: The network is out of range
marcelo@marcelo:~$


marcelo@marcelo:~$ route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0

marcelo@marcelo:~$ ifconfig
eth0 Link encap:Ethernet Endereço de HW 00:25:22:2f:ca:81
inet end.: 10.0.2.15 Bcast:10.0.2.255 Masc:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:26 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:212 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:5281 (5.2 KB) TX bytes:39639 (39.6 KB)

lo Link encap:Loopback Local
inet end.: 127.0.0.1 Masc:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Métrica:1
pacotes RX:0 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:0 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


(my windows host)======================================================
C:\WINDOWS>ipconfig

Configuração de IP do Windows

Adaptador Ethernet Conexão Ethernet:
Sufixo DNS específico de conexão . :
Endereço IP . . . . . . . . . . . . : 192.168.1.1
Máscara de sub-rede . . . . . . . . : 255.255.255.0
Gateway padrão. . . . . . . . . . . : 192.168.1.254

Adaptador Ethernet VirtualBox Host-Only Network:
Sufixo DNS específico de conexão . :
Endereço IP . . . . . . . . . . . . : 192.168.56.1
Máscara de sub-rede . . . . . . . . : 255.255.255.0
Gateway padrão. . . . . . . . . . . :

Re: I can download using wget in linux but cUrl fails to htt

Posted: 9. Jul 2012, 19:36
by xlis
curl seems to be trying to connect to an IPv6 address.
Try adding the "--ipv4" option to the curl command

Code: Select all

curl --ipv4 ...

Re: I can download using wget in linux but cUrl fails to htt

Posted: 9. Jul 2012, 21:01
by MarceloCastro
Hi xlis,

you tip works fine ..thanks
curl --ipv4 https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

the funny is that I already tried tried two methods to disable ipv6 and force ipv4 but nothing happened.
method 1)
in network adapter, setting it the tab "configuration ipv6" setting the method = IGNORE..
but this doesn't have any effect..

method 2)
http://pario.no/2011/12/09/disable-ipv6 ... ntu-11-10/

method 1 and 2, fails... but passing the parameters in cUrl --ipv4 , works like a charm...

but still getting error messages with https ...

marcelo@marcelo:~/android/system$ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out


any help?
xlis wrote:curl seems to be trying to connect to an IPv6 address.
Try adding the "--ipv4" option to the curl command

Code: Select all

curl --ipv4 ...