[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Issue/bug with wget over https and proxy
From:       Jakub_Ledwoń <ledwojakub () gmail ! com>
Date:       2019-01-23 12:20:56
Message-ID: CAKH58VO17z54Q6+2fGDH__pNS7NpYR6JPoaqii1UPFS_4ErDog () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I checked the logs, and the difference is:
BusyBox is sending GET request:
*12:54:38.515492 IP my_ip > proxy_ip: Flags [P.], seq 1:151, ack 1, win
229, options [nop,nop,TS val 4062059628 ecr 2056253471], length 150: HTTP:
GET https://raw.githubusercontent.com/mirror/busybox/master/INSTALL
<https://raw.githubusercontent.com/mirror/busybox/master/INSTALL> HTTP/1.1*
which results in 502 Bad Gateway response.
While GNU wget is using CONNECT method:
*12:52:51.203465 IP my_ip > proxy_ip: Flags [P.], seq 1:125, ack 1, win
229, options [nop,nop,TS val 4061952316 ecr 2056146160], length 124: HTTP:
CONNECT raw.githubusercontent.com:443
<http://raw.githubusercontent.com:443> HTTP/1.1*

which seems to be a correct approach, since I'm using http proxy.

Best regards,
Jakub Ledwon

pon., 21 sty 2019 o 16:47 Denys Vlasenko <vda.linux@googlemail.com>
napisał(a):

> On Mon, Jan 21, 2019 at 2:53 PM Jakub Ledwoń <ledwojakub@gmail.com> wrote:
> > I have env variables set up like this:
> > http_proxy=http://proxy_ip:8080
> > https_proxy=http://proxy_ip:8080
> > ftp_proxy=http://proxy_ip:8080
> > When I'm trying to use wget on https link behind this proxy, it fails.
> On http links it works without issues. I'm using v1.30.0 version of busybox.
> >>
> >> ./busybox wget
> https://raw.githubusercontent.com/mirror/busybox/master/INSTALL -O
> test.txt
> >> Connecting to proxy_ip:8080 (proxy_ip:8080)
> >> wget: server returned error: HTTP/1.1 502 Bad Gateway
> >
> > All others standard online console utilities works without issues.
> > GNU wget behaves as expected.
> >>
> >> wget https://raw.githubusercontent.com/mirror/busybox/master/INSTALL
> -O test.txt
> >> --2019-01-21 14:48:42--
> https://raw.githubusercontent.com/mirror/busybox/master/INSTALL
> >> Connecting to proxy_ip:8080... connected.
> >> Proxy request sent, awaiting response... 200 OK
> >> Length: 6116 (6.0K) [text/plain]
> >> Saving to: ‘test.txt'
>
> We need to compare what is being sent to proxy_ip:8080
> bu GNU wget, and by bbox wget. Evidently, there is some difference.
>
> This command should do it:
>
> tcpdump -nl -ieth0 -xX host proxy_ip and port 8080
>

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I checked the logs, \
and the difference is:</div><div>BusyBox is sending GET \
request:</div><div><i>12:54:38.515492 IP my_ip &gt; proxy_ip: Flags [P.], seq 1:151, \
ack 1, win 229, options [nop,nop,TS val 4062059628 ecr 2056253471], length 150: HTTP: \
GET <a href="https://raw.githubusercontent.com/mirror/busybox/master/INSTALL">https://raw.githubusercontent.com/mirror/busybox/master/INSTALL</a> \
HTTP/1.1</i></div><div>which results in 502 Bad Gateway response.</div><div>While GNU \
wget is using CONNECT method:</div><div><i>12:52:51.203465 IP my_ip &gt; proxy_ip: \
Flags [P.], seq 1:125, ack 1, win 229, options [nop,nop,TS val 4061952316 ecr \
2056146160], length 124: HTTP: CONNECT <a \
href="http://raw.githubusercontent.com:443">raw.githubusercontent.com:443</a> \
HTTP/1.1</i></div><div><br></div><div>which seems to be a correct approach, since \
I&#39;m using http proxy.</div><div><br></div><div>Best regards, <br></div><div>Jakub \
Ledwon<br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">pon., 21 sty 2019 o 16:47  Denys Vlasenko &lt;<a \
href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a>&gt; \
napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jan 21, 2019 \
at 2:53 PM Jakub Ledwoń &lt;<a href="mailto:ledwojakub@gmail.com" \
target="_blank">ledwojakub@gmail.com</a>&gt; wrote:<br> &gt; I have env variables set \
up like this:<br> &gt; http_proxy=<a href="http://proxy_ip:8080" rel="noreferrer" \
target="_blank">http://proxy_ip:8080</a><br> &gt; https_proxy=<a \
href="http://proxy_ip:8080" rel="noreferrer" \
target="_blank">http://proxy_ip:8080</a><br> &gt; ftp_proxy=<a \
href="http://proxy_ip:8080" rel="noreferrer" \
target="_blank">http://proxy_ip:8080</a><br> &gt; When I&#39;m trying to use wget on \
https link behind this proxy, it fails. On http links it works without issues. \
I&#39;m using v1.30.0 version of busybox.<br> &gt;&gt;<br>
&gt;&gt; ./busybox wget <a \
href="https://raw.githubusercontent.com/mirror/busybox/master/INSTALL" \
rel="noreferrer" target="_blank">https://raw.githubusercontent.com/mirror/busybox/master/INSTALL</a> \
-O test.txt<br> &gt;&gt; Connecting to proxy_ip:8080 (proxy_ip:8080)<br>
&gt;&gt; wget: server returned error: HTTP/1.1 502 Bad Gateway<br>
&gt;<br>
&gt; All others standard online console utilities works without issues.<br>
&gt; GNU wget behaves as expected.<br>
&gt;&gt;<br>
&gt;&gt; wget <a href="https://raw.githubusercontent.com/mirror/busybox/master/INSTALL" \
rel="noreferrer" target="_blank">https://raw.githubusercontent.com/mirror/busybox/master/INSTALL</a> \
-O test.txt<br> &gt;&gt; --2019-01-21 14:48:42--   <a \
href="https://raw.githubusercontent.com/mirror/busybox/master/INSTALL" \
rel="noreferrer" target="_blank">https://raw.githubusercontent.com/mirror/busybox/master/INSTALL</a><br>
 &gt;&gt; Connecting to proxy_ip:8080... connected.<br>
&gt;&gt; Proxy request sent, awaiting response... 200 OK<br>
&gt;&gt; Length: 6116 (6.0K) [text/plain]<br>
&gt;&gt; Saving to: ‘test.txt'<br>
<br>
We need to compare what is being sent to proxy_ip:8080<br>
bu GNU wget, and by bbox wget. Evidently, there is some difference.<br>
<br>
This command should do it:<br>
<br>
tcpdump -nl -ieth0 -xX host proxy_ip and port 8080<br>
</blockquote></div>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic