aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/ssh/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-04-16 04:17:19 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-04-16 04:17:19 +0200
commit570d0e57186da1e404ef28e1ea53fdd25a0a6043 (patch)
tree2609c5d95e795e6f7d3c21ee963e5fe27b76830c /plumbing/transport/ssh/common.go
parent1ab2e250673169e2e279af809539478993003673 (diff)
downloadgo-git-570d0e57186da1e404ef28e1ea53fdd25a0a6043.tar.gz
transport: ssh, default HostKeyCallback
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
}