It seems pkg have changed behavior when it comes to proxy settnings recently. I updated to pkg-2.4.2 and it changed. Today I also realized that pkg-static and pkg-2.4.2 on FreeBSD 15.0-RELEASE require different ENV variables to work with a http proxy. pkg-static want something like HTTP_PROXY_AUTH: "basic:*:user:pass" and pkg-2.4.2 want HTTP_PROXY_AUTH: "buser:pass". This causes problems when upgrading systems for example because you may need to use first pkg-static to bootstrap pkg, and then continue with pkg.
The problem is easy if you know how both work: pkg-static uses fetch(3), see manpage. pkg uses libcurl, see https://curl.se/libcurl/c/CURLOPT_PROXYUSERPWD.html. Don't know how to reconcile them...
Thanks! That explains the problem. But I think it should still be considered a problem that you need to change pkg.conf manually during system upgrade. Also, the FreeBSD 15 manual for pkg.conf(5) states that the PKG_ENV settings are compatible fetch(3).
(In reply to peter from comment #2) Yep, I do agree. The transport library is an implementation detail, but the env var is a public interface. Clearly, at least, a documentation issue or it should be rewritten on the fly.
Generally using pkg(8) and Poudriere in 'PROXY ENVIRONMENT' is PITA. I needed to dig a lot of custom settings to make it work ... and I still need to work on Poudriere part ... Details: - https://github.com/freebsd/poudriere/issues/1279#issuecomment-3530320210