From fb99d50fa1d2d38ef6b4d8fa63c81b27fa6123bd Mon Sep 17 00:00:00 2001 From: Dmitry Neverov Date: Mon, 18 Jan 2016 16:52:38 +0100 Subject: [PATCH] Fix #2431 - handle requests waiting for reply According to the docs [1], the Reply method must be called for all requests where WantReply is true. This fixes a hanging java ssh implementation (jsch) which sets WantReply flag and waits for reply from the server. [1] https://godoc.org/golang.org/x/crypto/ssh#Request.Reply --- modules/ssh/ssh.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 15ba02a2b..41a870663 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -91,6 +91,7 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) { return } + req.Reply(true, nil); go io.Copy(input, ch) io.Copy(ch, stdout) io.Copy(ch.Stderr(), stderr)