go: x/crypto/ssh: ssh: handshake failed: ssh: unexpected message type 3 (expected one of [6])

What version of Go are you using (go version)?

go version go1.7.4 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH=“amd64” GOBIN=“” GOEXE=“” GOHOSTARCH=“amd64” GOHOSTOS=“darwin” GOOS=“darwin” GOPATH=“/Users/lucaswxp” GORACE=“” GOROOT=“/usr/local/go” GOTOOLDIR=“/usr/local/go/pkg/tool/darwin_amd64” CC=“clang” GOGCCFLAGS=“-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mw/y5nw62813y9105dl9n5wy6_40000gn/T/go-build710665517=/tmp/go-build -gno-record-gcc-switches -fno-common” CXX=“clang++” CGO_ENABLED=“1”

What did you do?

Tried creating a SSH client:

  c := &ssh.ClientConfig{User:"a",Auth:[]ssh.AuthMethod{ssh.Password("b")}}
  _, err := ssh.Dial("tcp", "x.x.x.x:22", c)

  if err != nil {
    fmt.Printf("%s", err)
 }

What did you expect to see?

Successful login. I can login in terminal, but any host I put in .Dial() I get the following error:

What did you see instead?

ssh: handshake failed: ssh: unexpected message type 3 (expected one of [6])

What is type 3 error? Any host I put I get this message.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 35 (13 by maintainers)

Commits related to this issue

Most upvoted comments

oh, I can see this on tests against openssh. Investigating.

can people try out https://go-review.googlesource.com/c/36055/1 to see if that fixes things?

this is now submitted. Can y’all try out https://go.googlesource.com/crypto/+/77014cf7f9bde4925afeed52b7bf676d5f5b4285 and see if it fixes things for you?

you can fetch the change by doing:

git fetch https://go.googlesource.com/crypto refs/changes/55/36055/1 && git checkout FETCH_HEAD

I was perplexed for a while, so I see where you’re coming from. 😃

On the right side of https://go-review.googlesource.com/c/36055/1 there’s a download button. It saves a complete junk, which you can decode with base64 -d command. After that go to your $GOPATH/golang.org/x/crypto folder and apply what you got from base64 utility with patch -p1 < ssh-patch.diff and finally recompile the utility which uses the library.

Yeah, too complicated IMHO, that gerrit tool not very user friendly, it seems.