phhtpget won't interpret an HTTP_PROXY env var that includes auth information
(which';fetch' needs) correctly.
It has to do this because ;fetch; won't fetch without this info, as
trying to use HTTP_PROXY_AUTH instead doesn't work at all with fetch.
How-To-Repeat: so with
phttpget (as used by FreeBSD7.0 freebsd-update) will return stuff
Fetching 2 metadata patches...
/usr/libexec/phttpget update1.FreeBSD.org 7.0-
phttpget: host = user, port = firstname.lastname@example.org:3128: servname
not supported for ai_socktype
and will in fact try to install those patches without reporting an error.
Over to maintainer.
Probably this patch would help on
I applied the submitted patch to phttpget and tested it on one of our
lab machines that runs
FreeBSD 9.0-Release amd64 and sits behind a HTTP proxy with required
The patch worked without a problem.
This patch would also solve misc/126131.
Just reporting that Normunds' patch worked for me too.
FreeBSD 9.0-Release amd64 behind a HTTP proxy server with required authentication.
Stephen K. Karanja
For bugs that match the following
- Status Is In progress
- Untouched since 2018-01-01.
- Affects Base System OR Documentation
Reset to open status.
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
I found the root cause.
There's a bug with the Base64 Encoding within the b64enc function.
The Filling isn't applied in most of the cases.
"Hey:Base64" should be encoded to "SGV5OkJhc2U2NA=="
But due to wrong filling it's getting encoded to "SGV5OkJhc2U2NAA=".
This can be replicated with every "username:password" combination where the combined length is not a multiple of 3 (due to the issue when filling comes in place).
So "H:B", "HE:Bas" and "Hey:Base6" as username and Password are fine for example.
Should be easy to replicate for the maintainer. I tested it myself with another Base64 Encoding Implementation by Jouni Melinen (which is apparently the fastest) and it worked flawlessly.
Created attachment 201165 [details]
b64enc fix and use fetch API
Concerning how phttpget parses HTTP_PROXY, I would suggest using fetchParseURL from <fetch.h> instead of parsing it manually (similar to how http_get_proxy() is handled). That way we can ensure it's parsed the same way as "fetch" does.
Additionally it seems like there's an off-by-one error in b64enc.
This patch showcases how the fetch API could be used and fixes b64enc.
Drop freebsd-update PRs which were assigned to me. I'm not working on this code any more.