aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/ssh/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/ssh/common.go')
-rw-r--r--plumbing/transport/ssh/common.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/plumbing/transport/ssh/common.go b/plumbing/transport/ssh/common.go
index 5ed64d4..9b484f9 100644
--- a/plumbing/transport/ssh/common.go
+++ b/plumbing/transport/ssh/common.go
@@ -82,7 +82,13 @@ func (c *command) connect() error {
}
var err error
- c.client, err = ssh.Dial("tcp", c.getHostWithPort(), c.auth.clientConfig())
+ config := c.auth.clientConfig()
+ config.HostKeyCallback, err = c.auth.hostKeyCallback()
+ if err != nil {
+ return err
+ }
+
+ c.client, err = ssh.Dial("tcp", c.getHostWithPort(), config)
if err != nil {
return err
}