diff --git a/ssh/certs_test.go b/ssh/certs_test.go index d6c4a33719..c5f2e53304 100644 --- a/ssh/certs_test.go +++ b/ssh/certs_test.go @@ -186,15 +186,15 @@ func TestHostKeyCert(t *testing.T) { defer c1.Close() defer c2.Close() + errc := make(chan error) + go func() { conf := ServerConfig{ NoClientAuth: true, } conf.AddHostKey(certSigner) _, _, _, err := NewServerConn(c1, &conf) - if err != nil { - t.Fatalf("NewServerConn: %v", err) - } + errc <- err }() config := &ClientConfig{ @@ -207,5 +207,10 @@ func TestHostKeyCert(t *testing.T) { if (err == nil) != succeed { t.Fatalf("NewClientConn(%q): %v", name, err) } + + err = <-errc + if (err == nil) != succeed { + t.Fatalf("NewServerConn(%q): %v", name, err) + } } }