implement DialAddrNonFWSecure for the client

This commit is contained in:
Marten Seemann
2017-05-12 23:16:00 +08:00
parent 33a9b5aae4
commit 74f607ce21
2 changed files with 28 additions and 0 deletions

View File

@@ -82,6 +82,20 @@ var _ = Describe("Client", func() {
close(done)
})
It("dials a non-forward-secure address", func(done Done) {
var dialedSess Session
go func() {
defer GinkgoRecover()
var err error
dialedSess, err = DialAddrNonFWSecure("localhost:18901", config)
Expect(err).ToNot(HaveOccurred())
}()
Consistently(func() Session { return dialedSess }).Should(BeNil())
sess.handshakeChan <- handshakeEvent{encLevel: protocol.EncryptionSecure}
Eventually(func() Session { return dialedSess }).ShouldNot(BeNil())
close(done)
})
It("Dial only returns after the handshake is complete", func(done Done) {
var dialedSess Session
go func() {