-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/crypto/ssh: ssh: handshake failed: ssh: unexpected message type 3 (expected one of [6]) #18861
Comments
I'm hitting this too. I've done a little bisecting, and it looks like this is the offending commit: |
const msgUnimplemented = 3 what does the remote end run? Can you run with debugHandshake and post the log output? |
oh, I can see this on tests against openssh. Investigating. |
Hitting this bug, too. go1.8rc3 linux/amd64 Tnx for looking into it. |
The bug was also present in 1.7.1. |
the Go version is probably irrelevant. This must be related to the recent changes in the SSH code. |
Here is a debug output of a failed connection. Maybe that helps. debug2: load_server_config: filename /etc/ssh/sshd_config |
can people try out https://go-review.googlesource.com/c/36055/1 to see if that fixes things? |
@hanwen yep, that fixes things for me. |
@hanwen ditto, fixes my issues too, consistent connections |
Works fine here now, thank you @hanwen for your work! |
Hey guys, sorry, noob question here: Regards |
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. |
@zcalusic Ahh, that worked! Thanks, solved for me. |
I just ran into this to in the sftp package. It was triggering multiple integration tests to fail. I bisected it to the same commit (a59c127) and then found this ticket. I tried your commit and it fixed it for me as well. |
you can fetch the change by doing: git fetch https://go.googlesource.com/crypto refs/changes/55/36055/1 && git checkout FETCH_HEAD |
I've temporarily added @hanwen 's step above to my build script and that has solved the problem for me pending a permanent fix |
This started occurring after a few runs successfully runs via my ide(intellij) and by hand. Found this and reviewed/applied the patch for local builds. Thus far, the issue looks to have been resolved. I will update if I see the issue again today with the patch in place. Thank you for finding and working on this so quickly. |
golang/go#18861 Forking for now until it's in master
I also hit this issue and the patch fixed it. Thanks! If anyone wants--- I've got a temporary fork of x/crypto master with the patch applied, until it gets into master. Here -> https://github.com/yobert/crypto |
This pulls the fix into travis build to tests can continue while they get this bug merged upstream. golang/go#18861
This pulls the fix into travis build to tests can continue while they get this bug merged upstream. golang/go#18861
This pulls the fix into travis build to tests can continue while they get this bug merged upstream. golang/go#18861
This pulls the fix into travis build to tests can continue while they get this bug merged upstream. golang/go#18861
This pulls the fix into travis build to tests can continue while they get this bug merged upstream. Once merged this should be reverted. golang/go#18861
this is now submitted. Can y'all try out https://go.googlesource.com/crypto/+/77014cf7f9bde4925afeed52b7bf676d5f5b4285 and see if it fixes things for you? |
I was hitting this. It works now after applying the patch. |
Works fine here. 👍 |
Fixed it for me. Thanks. |
Does the crypto repository have any kind of CI? It seems this could have been discovered automatically by CI. |
@unclejack, it does. See https://build.golang.org/ at the bottom. But that doesn't mean that the ssh package has perfect test coverage. |
Hmm - is this really merged to master so that a go get golang.org/x/crypto/ssh would retrieve this fix? I ask b/c I re-ran my build scripts yesterday and my nightly batch processes still failed with this error? |
@unclejack The supposed fix golang/crypto@77014cf is in master for 2 days and seems to be working for a lot of people (including me). Are you sure your tests used the latest master? |
@bradfitz - see https://go.googlesource.com/crypto/+/ed03dad8de553b023b198606d52b6d968ad57b39 it would be great if these tests could run a couple of select platforms, such as linux. @CameronGo did you supply -u to "go get" ? |
@unclejack - there are extensive unittests. Unfortunately, this issue is very sensitive to timing and scheduling. If you know of a way to exercise all the different orderings in which events can happen, let us know. |
@hanwen - my jenkins scripts use the docker golang images, so the GOHOME is always empty when it launches, so the packages always get pulled. Still, I triggered another rebuild yesterday and my batch processes last night did not encounter any errors, so I'll keep an eye on it for the next couple of days, but I'm in good shape right now. |
If this helps anyone trying to write a test case--- I didn't get this error until I started using an encrypted key via SSH agent. Loading the same key (but unencrypted) directly from disk worked just fine. |
This issue is fixed, so closing this bug. |
When will this get to stable release? I'm on latest 1.8 (from golang.org) and the issue is still here. |
@simon-s9, the "ssh" package is not part of the Go standard library, so whether you're on Go 1.8 or Go 1.6 is irrelevant. You just need to "go get -u" update the package. |
This pulls in a fix for golang/go#18861. Fixes #290.
This pulls in a fix for golang/go#18861. Fixes #290.
The previous attempt would fail in the following scenario: * select picks "first" kex from requestKex * read loop receives a remote kex, posts on requestKex (which is now empty) [*] for sending out a response, and sends pendingKex on startKex. * select picks pendingKex from startKex, and proceeds to run the key exchange. * the posting on requestKex in [*] now triggers a second key exchange. Fixes golang#18861. Change-Id: I443e82f1d04c7f17d1485fdb87072b9feec26aa8 Reviewed-on: https://go-review.googlesource.com/36055 Run-TryBot: Han-Wen Nienhuys <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Han-Wen Nienhuys <[email protected]>
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:
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.
The text was updated successfully, but these errors were encountered: