Skip to content

connhelper: return original daemonURL for ssh host#7104

Open
SparshGarg999 wants to merge 1 commit into
docker:masterfrom
SparshGarg999:6164-ssh-daemon-host
Open

connhelper: return original daemonURL for ssh host#7104
SparshGarg999 wants to merge 1 commit into
docker:masterfrom
SparshGarg999:6164-ssh-daemon-host

Conversation

@SparshGarg999

Copy link
Copy Markdown

- What I did
Fixed connection helper for SSH scheme to return the original daemonURL as the Host instead of the hardcoded dummy "http://docker.example.com". This fixes #6164.

- How I did it
Modified getConnectionHelper in cli/connhelper/connhelper.go to return Host: daemonURL under u.Scheme == "ssh". The URL parser and client transport will correctly cut the scheme and host, preserving the correct host for DaemonHost() and matching proxy settings (like NO_PROXY), while keeping connection setup via SSH dialer intact.

- How to verify it
Added a unit test TestGetConnectionHelper in cli/connhelper/connhelper_test.go verifying that the Host field matches the original SSH daemon URL.

- Human readable description for the release notes

connhelper: return original daemonURL for ssh host to resolve incorrect host reporting and proxy matching issues.

This fixes issue docker#6164 where DaemonHost() returns the hardcoded http://docker.example.com dummy URL for SSH transport connection helpers. Returning the original daemonURL resolves incorrect host reporting and allows proper proxy key/NO_PROXY matching for SSH endpoints.

Signed-off-by: Sparsh Garg <76697238+SparshGarg999@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DaemonHost() returns http://docker.example.com for ssh transport

1 participant