[Bug]: RegistryClient ignores credentials in HTTPS_PROXY, so image pulls fail with proxyAuthenticationRequired
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- swift
- 领域
- networking
调研方向
从 RegistryClient 开始,那里的 httpConfiguration.proxy 由代理主机和端口设置。找到 HTTPS_PROXY 被读取和解析的位置。使用 .basic(username:password:),将代理 URL 中的用户名和密码传入 HTTPClient.Configuration.Proxy.server(host:port:authorization:)。当经过需要 Basic 认证的代理的请求发送 Proxy-Authorization 请求头,并且不带凭据的代理 URL 行为与之前一致时,即完成。
由索引模型根据 Issue 内容生成。
描述
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
I reproduced this through container 1.7.1, which pins containerization at baf212e. The setup is the same as apple/container#2499: a user that has never used container, and a local proxy on 127.0.0.1:18080 that requires Basic auth with repro:secret. curl gets a 200 through the same proxy URL.
$ HTTPS_PROXY=http://repro:[email protected]:18080 container system start --disable-kernel-install
$ container image pull --progress plain docker.io/library/alpine:3.20
[1/2] Fetching image [43s]
Error: HTTPClientError.proxyAuthenticationRequired
The services that system start launches inherit HTTPS_PROXY, so the pull goes through the proxy. With the services started without the proxy, the same pull succeeds. It happens every time.
Current behavior
RegistryClient never sends a Proxy-Authorization header. It keeps only the proxy's host and port. The line is the same at baf212e and on main:
httpConfiguration.proxy = HTTPClient.Configuration.Proxy.server(host: proxyHost, port: proxyPort)
Current behavior
RegistryClient never sends a Proxy-Authorization header. It keeps only the proxy's host and port. The line is the same at baf212e and on main:
httpConfiguration.proxy = HTTPClient.Configuration.Proxy.server(host: proxyHost, port: proxyPort)
Expected behavior
The user and password in the proxy URL are sent as Basic proxy auth, as curl does with the same variable. AsyncHTTPClient accepts them with .server(host:port:authorization: .basic(username:password:)).
Environment
- OS: macOS 27.2 (26B123)
- Xcode: not installed (Command Line Tools 27.0)
- Swift: Apple Swift version 6.4 (swiftlang-6.4.0.34.1 clang-2100.3.34.1)
- Containerization: `baf212e`, through container CLI 1.7.1 (Homebrew)
Relevant log output
The proxy log shows 21 CONNECTs over about 40 seconds, none with credentials, although the proxy keeps the connection open after each 407:
23:33:15 CONNECT registry-1.docker.io:443 Proxy-Authorization=absent -> 407
...
23:33:53 CONNECT registry-1.docker.io:443 Proxy-Authorization=absent -> 407
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Swift
- 星标
- 9k
- 派生
- 412
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apple/containerization 的其他 Issue
-
[Bug]: archive ownership changes clear set-ID permission bits可能已有人在做 @maksim-romanov 于 100 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apple/containerization#819 · 1 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
[Bug]: archive extraction strips special permission bits可能已有人在做 @maksim-romanov 于 100 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apple/containerization#818 · 2 条评论 ·
维护者通常 2 天内回复
-
LinuxContainer.create() leaks the VZ VM/XPC process when vm.start() throws — no do/catch around it可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apple/containerization#804 · 1 条评论 ·
维护者通常 2 天内回复
-
[Bug]: TimeSyncer steps the guest clock backward every 30 s, and the first sync steps it by up to ±0.5 s可能已有人在做 @castlemilk 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 46/100
apple/containerization#1019 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 65/100
apple/containerization#1017 ·
维护者通常 2 天内回复
查看 apple/containerization 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
fxios-coreexperience
难度 2/5 1-3 小时 新手友好度 68/100
mozilla-mobile/firefox-ios#36661 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
manaflow-ai/cmux#45713 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 67/100
alejandrobujan/tendedero#151 ·
维护者通常 2 天内回复