forked from quic-go/quic-go
return the encryption level of a packet when decrypting it
This commit is contained in:
@@ -45,9 +45,10 @@ var _ h2quicClient = &Client{}
|
||||
// NewClient creates a new client
|
||||
func NewClient(t *QuicRoundTripper, tlsConfig *tls.Config, hostname string) *Client {
|
||||
c := &Client{
|
||||
t: t,
|
||||
hostname: authorityAddr("https", hostname),
|
||||
responses: make(map[protocol.StreamID]chan *http.Response),
|
||||
t: t,
|
||||
hostname: authorityAddr("https", hostname),
|
||||
responses: make(map[protocol.StreamID]chan *http.Response),
|
||||
encryptionLevel: protocol.EncryptionUnencrypted,
|
||||
}
|
||||
c.cryptoChangedCond = sync.Cond{L: &c.mutex}
|
||||
c.config = &quic.Config{
|
||||
|
||||
@@ -90,7 +90,7 @@ var _ = Describe("Client", func() {
|
||||
})
|
||||
|
||||
It("sets the correct crypto level", func() {
|
||||
Expect(client.encryptionLevel).To(Equal(protocol.Unencrypted))
|
||||
Expect(client.encryptionLevel).To(Equal(protocol.EncryptionUnencrypted))
|
||||
client.config.ConnState(session, quic.ConnStateSecure)
|
||||
Expect(client.encryptionLevel).To(Equal(protocol.EncryptionSecure))
|
||||
client.config.ConnState(session, quic.ConnStateForwardSecure)
|
||||
|
||||
Reference in New Issue
Block a user