|
1 | 1 | diff --git a/src/transports/ssh.c b/src/transports/ssh.c |
2 | | -index 471c3273ed..32189d0979 100644 |
| 2 | +index 89f085230..b8bdca61a 100644 |
3 | 3 | --- a/src/transports/ssh.c |
4 | 4 | +++ b/src/transports/ssh.c |
5 | | -@@ -525,6 +525,7 @@ static int _git_ssh_setup_conn( |
| 5 | +@@ -467,6 +467,7 @@ static int _git_ssh_setup_conn( |
6 | 6 | git_credential *cred = NULL; |
7 | 7 | LIBSSH2_SESSION *session=NULL; |
8 | 8 | LIBSSH2_CHANNEL *channel=NULL; |
9 | 9 | + char *host_and_port; |
10 | 10 |
|
11 | 11 | t->current_stream = NULL; |
12 | 12 |
|
13 | | -@@ -636,7 +637,15 @@ post_extract: |
| 13 | +@@ -567,10 +568,18 @@ static int _git_ssh_setup_conn( |
14 | 14 |
|
15 | 15 | cert_ptr = &cert; |
16 | 16 |
|
17 | | -- error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, urldata.host, t->owner->message_cb_payload); |
18 | | -+ if (atoi(urldata.port) == SSH_DEFAULT_PORT) { |
19 | | -+ host_and_port = urldata.host; |
| 17 | ++ if (atoi(s->url.port) == SSH_DEFAULT_PORT) { |
| 18 | ++ host_and_port = s->url.host; |
20 | 19 | + } else { |
21 | | -+ size_t n = strlen(urldata.host) + strlen(urldata.port) + 2; |
| 20 | ++ size_t n = strlen(s->url.host) + strlen(s->url.port) + 2; |
22 | 21 | + host_and_port = alloca(n); |
23 | | -+ sprintf(host_and_port, "%s:%s", urldata.host, urldata.port); |
| 22 | ++ sprintf(host_and_port, "%s:%s", s->url.host, s->url.port); |
24 | 23 | + } |
25 | 24 | + |
26 | | -+ error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, host_and_port, t->owner->message_cb_payload); |
| 25 | + error = t->owner->connect_opts.callbacks.certificate_check( |
| 26 | + (git_cert *)cert_ptr, |
| 27 | + 0, |
| 28 | +- s->url.host, |
| 29 | ++ host_and_port, |
| 30 | + t->owner->connect_opts.callbacks.payload); |
27 | 31 |
|
28 | 32 | if (error < 0 && error != GIT_PASSTHROUGH) { |
29 | | - if (!git_error_last()) |
|
0 commit comments