wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget2 | Can't connect to HTTPS host using proxy with http:// url sch


From: Avinash Sonawane (@rootkea)
Subject: Re: wget2 | Can't connect to HTTPS host using proxy with http:// url scheme (#217)
Date: Sun, 06 Mar 2022 17:08:06 +0000



Avinash Sonawane commented:


Hello Tim!

How have you been?! I missed you all (you, Darshit, Akash, Didik, etc.)!

I'm planning to resume `wget2` development (which I've been wanted to do for a 
very long time!).

It's just that I'm in the middle of many things at the moment and that's why I 
restricted myself from commenting on this issue the day I cross-referenced as I 
didn't want to post shallow comment(s). :)

Anyways, I came up with the following change that day (please don't judge me as 
I merely spent 2-3 minutes before trying this and this doesn't work BTW!).

```
@@ -620,7 +620,7 @@ int wget_http_open(wget_http_connection **_conn, const 
wget_iri *iri)
                port;
        int
                rc,
-               ssl = iri->scheme == WGET_IRI_SCHEME_HTTPS;
+               ssl;
 
        if (!_conn)
                return WGET_E_INVALID;
@@ -629,6 +629,7 @@ int wget_http_open(wget_http_connection **_conn, const 
wget_iri *iri)
 
        host = iri->host;
        port = iri->port;
+       ssl = iri->scheme == WGET_IRI_SCHEME_HTTPS;
 
        wget_thread_mutex_lock(proxy_mutex);
        if (!wget_http_match_no_proxy(no_proxies, iri->host)) {
@@ -638,11 +639,13 @@ int wget_http_open(wget_http_connection **_conn, const 
wget_iri *iri)
                        proxy = wget_vector_get(http_proxies, 
(++next_http_proxy) % wget_vector_size(http_proxies));
                        host = proxy->host;
                        port = proxy->port;
+                       ssl = proxy->scheme == WGET_IRI_SCHEME_HTTPS;
                        conn->proxied = 1;
                } else if (iri->scheme == WGET_IRI_SCHEME_HTTPS && 
https_proxies) {
                        proxy = wget_vector_get(https_proxies, 
(++next_https_proxy) % wget_vector_size(https_proxies));
                        host = proxy->host;
                        port = proxy->port;
+                       ssl = proxy->scheme == WGET_IRI_SCHEME_HTTPS;
                        conn->proxied = 1;
                }
        }
```

So clearly, I need to look more closely at how proxy requests are handled...

I also found 2 unreported issues with the build script BTW which I didn't 
report because, again, I didn't want to just post comment/report issue and then 
disappear. :)

Anyways, since this issue is very dear to me as this was the last issue I was 
working on before you made me focus on GSoC tasks (Thanks for that BTW!) I'll 
fix this issue if it remains open till the end of this month (mid-April most 
probably - that's when I should be able to be back with my usual pace :))

> Indeed should HTTP and HTTPS both go through either a http proxy or a https 
> proxy.

Ah, looks like there is some confusion. HTTP urls should use proxies from 
`http_proxy` and HTTPS urls should use proxies from `https_proxy`. Isn't it?

> what happens when both http_proxies *and* https_proxies is set ?

Umm same as above. We proxy HTTP urls through proxies from `http_proxy` and 
proxy HTTPS urls through proxies from `https_proxy`.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/issues/217#note_864325577
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]