crypto/ssh: fix tests on Go 1.7 on OpenBSD and Windows

Dialing the address (as returned by net.Addr().String() for a
net.Listen("tcp", ":1") address) is not yet guaranteed to work. It's
currently OS-dependent.

For some reason it works on Go 1.8+, but it hasn't yet been defined to
work reliably.

Fix the tests for now (since we need to support older Go releases),
even if this might work in the future.

Updates golang/go#18806

Change-Id: I2f0476b1d4f2673ab64ffedfa733f2d92fceb6ff
Run-TryBot: Brad Fitzpatrick <>
Run-TryBot: Han-Wen Nienhuys <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Han-Wen Nienhuys <>
2 files changed