-
Notifications
You must be signed in to change notification settings - Fork 46
Couldn't connect to remote git repository. #50
Comments
Looking through the event log I find this error: (Translated from Swedish) Application programs: Pass4Win.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Details: LibGit2Sharp.RepositoryNotFoundException Stack: at LibGit2Sharp.Repository..ctor (System.String, LibGit2Sharp.RepositoryOptions) at Pass4Win.frmMain..ctor () at Pass4Win.Program.Main () |
It's something to do with the CredentialProvider. If I edit the source myself and set hard coded values it works correctly. I'm no C# developer but I'll try to figure out what's going on here...
|
Good work. /// Encrypt the git password
/// </summary>
/// <param name="password"></param>
/// <param name="salt"></param>
/// <returns></returns>
static public string EncryptConfig(string password, string salt)
{
byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
byte[] saltBytes = Encoding.Unicode.GetBytes(salt);
byte[] cipherBytes = ProtectedData.Protect(passwordBytes, saltBytes, DataProtectionScope.CurrentUser);
return Convert.ToBase64String(cipherBytes);
}
/// <summary>
/// decrypts the git password
/// </summary>
/// <param name="cipher"></param>
/// <param name="salt"></param>
/// <returns></returns>
static public string DecryptConfig(string cipher, string salt)
{
byte[] cipherBytes = Convert.FromBase64String(cipher);
byte[] saltBytes = Encoding.Unicode.GetBytes(salt);
byte[] passwordBytes = ProtectedData.Unprotect(cipherBytes, saltBytes, DataProtectionScope.CurrentUser);
return Encoding.Unicode.GetString(passwordBytes); So basically making here unicode in utf8 might work.... |
I host my repo on my own gitlab git server but I can't get it to work. Are there any logs that I can check for more details? I have no problem accessing the repo via the browser.
I'm on Windows 10.
The text was updated successfully, but these errors were encountered: