-
Notifications
You must be signed in to change notification settings - Fork 897
LibGit2SharpException: could not find appropriate mechanism for credentials #2087
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
Comments
You mentioned #2065 but I think that only applies to proxies? I'm not sure if something else changed. Can you show the set up for your credentials and / or auth callback, and the callback that you're using (if you're using one)? What kind of provider are you authenticating to? Do you know what mechanism you are expecting to use? (Basic, NTLM, etc) |
In the meantime I tried every version between 0.26.2 & 0.30.0 and it starts to break when I update to 0.29.0. I mention #2065 as that caused breaking changes compilation-wise. But it seemed a very small change to fix it (move CredentialsProvider & OnTransferProgress (2 properties of CloneOptions we used) to the FetchOptions from the CloneOptions). We use the DefaultCredentials() for the handler: And the OnTransferProgress is basically eventing if I understood correctly and is used to show the progress in the UI. I did the same changes in v0.28.0 as well (moving those to FetchOptions) and everything still works. |
I have some small issues with upgradeing my tool here https://github.com/michaelmsonne/GitHubBackupTool to use the new v. as stuff break and is changed - like 'CloneOptions' does not contain a definition for 'RepositoryOperationCompleted' and so on. Have tryed to move to the FetchOptions but not all works.. So for now the tool use v. 0.28 |
var cloneOptions = new CloneOptions();
cloneOptions.FetchOptions.CredentialsProvider = ... |
Any update/idea on why the credentials don't work anymore from 0.29 onwards? We're stuck on 0.28 but as that version has been made deprecated, our security team wants us to update this NuGet. |
Reproduction steps
Upgraded from v0.26.2 to v0.30.0, had compilation issues. Fair enough, we were quite out of date.
We changed the credentials provider as this was now located in the FetchOptions (see #2065).
I even tried setting the ProxyOptions.ProxyType to None as that was now Auto by default.
Has there anything changed regarding credentials between those versions? I didn't immediately spotted something on the releases/changes page.
Expected behavior
Everything keeps working as normal.
Actual behavior
Exception is thrown when trying to clone a repository:
LibGit2Sharp.LibGit2SharpException: could not find appropriate mechanism for credentials at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 136 at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) in /_/LibGit2Sharp/Core/Proxy.cs:line 278 at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in /_/LibGit2Sharp/Repository.cs:line 810
Version of LibGit2Sharp (release number or SHA1)
v0.30.0
Operating system(s) tested; .NET runtime tested
Windows 11
.NET Framework 4.8
The text was updated successfully, but these errors were encountered: