Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows OpenSSH ssh-agent not Supported by cargo from rustup #10237

Closed
yodaldevoid opened this issue Dec 28, 2021 · 2 comments · Fixed by rust-lang/rust#92374
Closed

Windows OpenSSH ssh-agent not Supported by cargo from rustup #10237

yodaldevoid opened this issue Dec 28, 2021 · 2 comments · Fixed by rust-lang/rust#92374
Labels
C-bug Category: bug

Comments

@yodaldevoid
Copy link

yodaldevoid commented Dec 28, 2021

Problem

Support for the Windows OpenSSH ssh-agent was added to libssh2 with libssh2/libssh2@c998f79 and added to libssh2-sys with version 0.2.22 (alexcrichton/ssh2-rs@3fe863b). libssh2-sys 0.2.23 looks to have been included at least since cargo 1.57.0 based on CI builds.

All that said, the copy of cargo pulled down by rustup doesn't seem to include a new enough version of libssh2-sys to include support for Windows OpenSSH. This can be confirmed by searching the binary for the string "openssh-ssh-agent" as this string must be in the binary to be able to talk to the agent. A similar string for Pageant ("PageantRequest") can be find in the binary from rustup.

Lastly, building cargo from source from the same commit as the binary pulled by rustup works fine.

Steps

No response

Possible Solution(s)

There may be a difference between the CI builds and those used for releases. If so, it may be that the version of libssh2-sys has been pinned either through Cargo.lock or some other means and needs to be updated.

Notes

No response

Version

cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:Schannel)
os: Windows 10.0.19043 (Windows 10 Pro) [64-bit]
@ehuss
Copy link
Contributor

ehuss commented Dec 28, 2021

I have posted rust-lang/rust#92374 to update it.

@yodaldevoid
Copy link
Author

Ah, releases use the lock file from the main Rust repo, that makes sense.

Thank you for making the PR.

bors added a commit that referenced this issue Jan 2, 2022
Update docs for windows ssh-agent.

This updates the documentation for SSH authentication using Windows and ssh-agent.

Per #10237 and rust-lang/rust#92374, Cargo now supports ssh-agent on Windows.

I'm about 80% sure this information is correct based on my reading of the code and testing.  The ssh-agent that is part of mingw (or git-for-windows) uses emulated sockets, which are not compatible with traditional Windows-style named pipes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants