Bug 291311 - Changed behavior for pkg using proxy
Summary: Changed behavior for pkg using proxy
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-30 20:47 UTC by peter
Modified: 2025-12-01 10:43 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description peter 2025-11-30 20:47:23 UTC
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.
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2025-11-30 21:31:01 UTC
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...
Comment 2 peter 2025-12-01 06:15:14 UTC
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).
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2025-12-01 07:50:18 UTC
(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.
Comment 4 Slawomir Wojciech Wojtczak 2025-12-01 10:43:32 UTC
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