From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH v3] fireinfo: support upstream proxy with authentication Date: Mon, 10 Dec 2018 19:09:14 +0000 Message-ID: <10C88F2A-B450-43E7-A08A-31592A29C442@ipfire.org> In-Reply-To: <2a086efa-013f-6a45-0641-7f0a89dd4493@link38.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3163192425791114903==" List-Id: --===============3163192425791114903== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, No, the Core Update is already tagged, built and uploaded to the mirrors. The release announcement is also ready, but Arne hasn=E2=80=99t released it, = yet. -Michael > On 10 Dec 2018, at 15:29, Peter M=C3=BCller wro= te: >=20 > Hello Michael, >=20 > is there any chance to get this into upcoming Core Update 126? >=20 > Thanks, and best regards, > Peter M=C3=BCller >=20 > Am 04.12.18 um 18:13 schrieb Peter M=C3=BCller: >> Fireinfo could not send its profile to https://fireinfo.ipfire.org/ >> if the machine is behind an upstream proxy which requires username >> and password. This is fixed by tweaking urllib2's opening handler. >>=20 >> To apply this on existing installations, the fireinfo package >> needs to be shipped during an update. >>=20 >> The third version of this patch fixes bogus indention, assembles >> proxy authentication string more readable and preserves HTTP >> proxy handler. >>=20 >> Fixes #11905 >>=20 >> Signed-off-by: Peter M=C3=BCller >> Cc: Michael Tremer >> --- >> src/sendprofile | 14 ++++++++++++-- >> 1 file changed, 12 insertions(+), 2 deletions(-) >> mode change 100644 =3D> 100755 src/sendprofile >>=20 >> diff --git a/src/sendprofile b/src/sendprofile >> old mode 100644 >> new mode 100755 >> index b836567..3ce68b9 >> --- a/src/sendprofile >> +++ b/src/sendprofile >> @@ -73,10 +73,20 @@ def send_profile(profile): >> request.add_header("User-Agent", "fireinfo/%s" % fireinfo.__version__) >>=20 >> # Set upstream proxy if we have one. >> - # XXX this cannot handle authentication >> proxy =3D get_upstream_proxy() >> + >> if proxy["host"]: >> - request.set_proxy(proxy["host"], "http") >> + # handling upstream proxies with authentication is more tricky... >> + if proxy["user"] and proxy["pass"]: >> + prx_auth_string =3D "http://%s:%s@%s/" % (proxy["user"], proxy["pass"]= , proxy["host"]) >> + >> + proxy_handler =3D urllib2.ProxyHandler({'http': prx_auth_string, 'http= s': prx_auth_string}) >> + auth =3D urllib2.HTTPBasicAuthHandler() >> + opener =3D urllib2.build_opener(proxy_handler, auth, urllib2.HTTPHandl= er) >> + urllib2.install_opener(opener) >> + else: >> + request.set_proxy(proxy["host"], "http") >> + request.set_proxy(proxy["host"], "https") >>=20 >> try: >> urllib2.urlopen(request, timeout=3D60) >>=20 >=20 >=20 > --=20 > Microsoft DNS service terminates abnormally when it recieves a response > to a DNS query that was never made. Fix Information: Run your DNS > service on a different platform. > -- bugtraq --===============3163192425791114903==--