mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-03-02 22:57:11 -05:00
Something adds extra characters to http proxy auth header #6423
Labels
No labels
Component: Accessibility
Component: Administration
Component: Auth
Component: CLI
Component: Channels
Component: Chapters
Component: Comments
Component: Custom Markdown
Component: Docker 🐳
Component: Documentation 📚
Component: Email
Component: Embed
Component: Federation 🎡
Component: Import/Export
Component: Live
Component: Metadata
Component: Mobile
Component: Moderation :godmode:
Component: Notifications
Component: Object storage
Component: Observability
Component: PeerTube Plugin 📦
Component: Player ⏯️
Component: Playlist
Component: Recommendation
Component: Redundancy
Component: Registration
Component: Runners
Component: SEO
Component: Search
Component: Security
Component: Stats
Component: Studio
Component: Studio
Component: Subscriptions
Component: Subtitles 💬
Component: Transcoding
Component: Upload
Component: Video Import
Component: i18n 🔡
Priority: High
Priority: Low
Priority: Roadmap
Status: Blocked ✋
Status: In Progress 🔜
Status: To Reproduce
Status: Waiting for answer
Template not filled
Type: Bug 🐛
Type: Discussion 💭
Type: Discussion 💭
Type: Duplicate ➿
Type: Feature Request ✨
Type: Maintenance 👷♀️
Type: Performance
Type: Question
UI
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/PeerTube#6423
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Herover on GitHub (Jan 23, 2026).
Describe the current behavior
After adding the HTTP_PROXY env variable, PeerTube seems to use a wrong
proxy-authorizationheader for object storage and talking with federated servers, but does use correct header for http youtube imports. Using Wireshark on the proxy server, I see a correctly encoded base64 string with the correct username:password part when decoded, but the decoded string also contains a newline followed by a number of white spaces (it seemed to vary between 4-6 when I tested, and changed depending on restarts) at the end (eg.0x0a 0x20 0x20 0x20 0x20). Testing using curl from the same host works perfectly.Object storage jobs gives this stack trace in the error log
while requests to federated give this
Corresponding errors are also visible on the proxy server (Squid).
The environment variable looks like
HTTP_PROXY="http://user:paaaaaaaaaaaaaaaaaaasword@IP_address:12345"without any obvious reasons that it should contain newlines or white spaces.Steps to reproduce
HTTP_PROXY="http://user:paaaaaaaaaaaaaaaaaaasword@IP_address:12345"to a http proxyBad response: 407errors in the logs on the admin page (severity error for object storage, warning for ex.processUpdateVideo) or in the terminalDescribe the expected behavior
PeerTube should use correct authorization header value.
Additional information
PeerTube instance:
Browser name, version and platforms on which you could reproduce the bug: Docker image chocobozzz/peertube:v8.0.1-trixie on a Debian 6.1.159-1 (2025-12-30) x86_64 host
Link to browser console log if relevant:
Link to server log if relevant (
journalctlor/var/www/peertube/storage/logs/):Additional note: I found that I only actually need the http imports to use a proxy, so I'm no longer using this env variable.
@Chocobozzz commented on GitHub (Jan 23, 2026):
Can you paste the log that starts with
Using proxy ...?Can you also provide the alphabet range of your username and password? Some special characters may be the issue
@Herover commented on GitHub (Jan 23, 2026):
{"level":"info","message":"Using proxy http://username:password@IP_address:12345.","label":"peertube.dk:443","tags":["request"],"timestamp":"2026-01-22T18:00:45.215Z"}(anonymized the username,password,ip address, but nothing else is changed)
@Herover commented on GitHub (Jan 23, 2026):
The username is just a short all lowercase a-z single word, password is lower case, upper case and numbers ex. j5ghwEV4cydWDfXYoGl7BUdqeA3DDYEWkEoZ9ojD
@Chocobozzz commented on GitHub (Jan 23, 2026):
I'm sorry I don't have any clue. Can you try to debug https://github.com/Chocobozzz/PeerTube/blob/develop/server/core/helpers/hpagent.ts#L47 directly on your server?
@ayaadev commented on GitHub (Jan 26, 2026):
Hi there. I just wanted to bump this as I likely have the same issue. Here's an extract of what all of my warning logs look like:
I can confirm that the environment variables inside the container,
HTTP_PROXYandHTTPS_PROXY, match what I set in the.envfile.That is the same format for my HTTP proxy as well. Perhaps that's a common denominator?
This is also being discussed at Framacolibri: https://framacolibri.org/t/http-proxies-are-unauthenticated-despite-correct-details/31221/4