Skip to content

Fix Windows SSH authentication issues #876

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

Closed
wants to merge 1 commit into from
Closed

Fix Windows SSH authentication issues #876

wants to merge 1 commit into from

Conversation

WSSDude
Copy link

@WSSDude WSSDude commented Sep 1, 2022

As was commented in issue #872 in comment, libssh2 on Windows uses WinCNG backend by default.

Its implementation is old and does not support modern key formats, making libgit2 (and by extension git2-rs bindings) unusable on Windows when one wishes to use SSH authentication, as only formats that won't cause infinite loop when trying to authenticate or fail are the ones that GitHub and others don't support anymore.

Utilizing openssl-on-win32 ssh2-rs feature allows for proper use of SSH authentication method on Windows builds without infinite loops and fails inside git2-rs.
This PR does just that - enables this feature.

I don't know if this is the best approach for this (I'm still a bit new to Rust), but doing this solved all SSH auth issues I had (and which probably cannot be solved otherwise on Windows OS without libssh2 updating WinCNG backend...)

@WSSDude
Copy link
Author

WSSDude commented Sep 1, 2022

Think CI may also need an update, looking at the output... Dont know what exactly went wrong, OpenSSL for the test seems misconfigured having quick glance at the output.

I have no compilation issues myself (although I use vendored OpenSSL package so that may have something to do with it)

@WSSDude WSSDude closed this by deleting the head repository Dec 31, 2022
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.

1 participant