Merge pull request #861 from lucas-clemente/cert-invalid-integrationtest

add an integration test for invalid certificates
This commit is contained in:
Marten Seemann
2017-10-02 18:16:20 -05:00
committed by GitHub

View File

@@ -149,4 +149,15 @@ var _ = Describe("Handshake RTT tests", func() {
// plus 1 RTT: the timer starts 0.5 RTTs after sending the first packet, and the CONNECTION_CLOSE needs another 0.5 RTTs to reach the client
expectDurationInRTTs(3)
})
It("errors when the client doesn't accept the certificate", func() {
// don't validate the client's address, send the certificate in the first flight
serverConfig.AcceptCookie = func(_ net.Addr, _ *quic.Cookie) bool {
return true
}
runServerAndProxy()
_, err := quic.DialAddr(proxy.LocalAddr().String(), nil, nil)
Expect(err).To(MatchError(qerr.ProofInvalid))
expectDurationInRTTs(1)
})
})