[Bug]: Kernel download ignores credentials in HTTPS_PROXY and fails with proxyAuthenticationRequired
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- swift
- Domain
- networking
Research direction
Start in Sources/Services/ContainerAPIService/Client/FileDownloader.swift at the proxy configuration line identified in the issue, and check how the proxy URL’s credentials can be passed to AsyncHTTPClient. The reported reproduction uses HTTPS_PROXY with Basic auth and container system start --enable-kernel-install; done means the kernel download authenticates successfully through the proxy.
Written by the indexing model from the issue text.
Description
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
Starting state: container 1.7.1 from Homebrew, run as a macOS user that has never used container. There is no ~/Library/Application Support/com.apple.container, and container system status reports apiserver is not running and not registered with launchd.
A local proxy on 127.0.0.1:18080 requires Basic auth with repro:secret.
- Check that the proxy works for a client that sends the credentials:
$ HTTPS_PROXY=http://repro:[email protected]:18080 curl -sS -o /dev/null -w "%{http_code}\n" https://github.com/kata-containers/kata-containers/releases 200 - Start
containerwith the same proxy:$ HTTPS_PROXY=http://repro:[email protected]:18080 container system start --enable-kernel-install Launching container-apiserver... Testing access to container-apiserver... Verifying machine API server is running... Installing kernel... Error: HTTPClientError.proxyAuthenticationRequired $ echo $? 1
It happens every time.
Problem description
The kernel download never sends a Proxy-Authorization header. The proxy keeps the connection open after each 407, but its log shows 20 CONNECTs over about 30 seconds, all without credentials:
23:32:45 CONNECT github.com:443 Proxy-Authorization=absent -> 407
...
23:33:14 CONNECT github.com:443 Proxy-Authorization=absent -> 407
Expected: the user and password in the proxy URL are sent as Basic proxy auth, as curl does with the same HTTPS_PROXY.
Sources/Services/ContainerAPIService/Client/FileDownloader.swift keeps only the proxy's host and port. The line is the same in 1.7.1 and on main:
httpConfiguration.proxy = HTTPClient.Configuration.Proxy.server(host: proxyHost, port: proxyURL.port ?? 8080)
AsyncHTTPClient can take the credentials with .server(host:port:authorization: .basic(username:password:)).
Image pulls have the same problem in containerization's RegistryClient: apple/containerization#1012.
CONTAINER_DEBUG=1 adds no output, and container system logs --last 10m has no related entries.
Environment
- OS: macOS 27.2 (26B123)
- Xcode: not installed (Command Line Tools 27.0)
- Container: container CLI version 1.7.1 (build: release, commit: unspeci), Homebrew `container` 1.7.1_1
Code of Conduct
- I agree to follow this project's Code of Conduct
- Dominant language
- Swift
- Stars
- 51.9k
- Forks
- 1.8k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apple/container
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug]: `container machine logs -f` exits immediately when the log is emptyPossibly taken @srivilliamsai claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apple/container#2492 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: Intermittent failure in PathUtilsTests.testNewDirectoryIsExcludedAndExistingChoiceIsKeptOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apple/container#2474 · 2 comments ·
Maintainers usually reply within 1 day
-
[Request]: container ls --filter label=key=valuePossibly taken @kavix claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apple/container#2403 · 1 comment ·
Maintainers usually reply within 1 day
-
[Request]: Improve robustness and path resolution in ensure-hawkeye.shPossibly taken @denizguney claimed this 45 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
🎉 Add MPP ViewerOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
jaywcjlove/awesome-mac#4728 ·
Maintainers usually reply within 1 day
-
compiler diagnostics quality ownership SIL ownership
Difficulty 1/5 Under an hour Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
T-Defect
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
element-hq/element-x-ios#6536 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
fxios-coreexperience
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mozilla-mobile/firefox-ios#36661 ·
Maintainers usually reply within 1 day