Skip to content

Commit 523d8b6

Browse files
committed
ssh: give a realistic error message
I spent an hour banging my head against this, when it was because the remote didn't trust my key.
1 parent 00893d2 commit 523d8b6

File tree

1 file changed

+2
-2
lines changed
  • src/libgit2/transports

1 file changed

+2
-2
lines changed

src/libgit2/transports/ssh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ static int check_certificate(
753753
if (error == GIT_PASSTHROUGH) {
754754
error = git_error_state_restore(&previous_error);
755755
} else if (error < 0 && !git_error_last()) {
756-
git_error_set(GIT_ERROR_NET, "user canceled hostkey check");
756+
git_error_set(GIT_ERROR_NET, "unknown remote host key");
757757
}
758758

759759
git_error_state_free(&previous_error);
@@ -1009,7 +1009,7 @@ static int list_auth_methods(int *out, LIBSSH2_SESSION *session, const char *use
10091009

10101010
/* either error, or the remote accepts NONE auth, which is bizarre, let's punt */
10111011
if (list == NULL && !libssh2_userauth_authenticated(session)) {
1012-
ssh_error(session, "Failed to retrieve list of SSH authentication methods");
1012+
ssh_error(session, "remote rejected authentication");
10131013
return GIT_EAUTH;
10141014
}
10151015

0 commit comments

Comments
 (0)