forked from quic-go/quic-go
@@ -53,6 +53,7 @@ func NewClient(t *QuicRoundTripper, tlsConfig *tls.Config, hostname string) *Cli
|
||||
c.cryptoChangedCond = sync.Cond{L: &c.mutex}
|
||||
c.config = &quic.Config{
|
||||
ConnState: c.connStateCallback,
|
||||
TLSConfig: tlsConfig,
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package h2quic
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -39,6 +40,12 @@ var _ = Describe("Client", func() {
|
||||
client.requestWriter = newRequestWriter(headerStream)
|
||||
})
|
||||
|
||||
It("saves the TLS config", func() {
|
||||
tlsConf := &tls.Config{InsecureSkipVerify: true}
|
||||
client = NewClient(&QuicRoundTripper{}, tlsConf, "")
|
||||
Expect(client.config.TLSConfig).To(Equal(tlsConf))
|
||||
})
|
||||
|
||||
It("adds the port to the hostname, if none is given", func() {
|
||||
client = NewClient(quicTransport, nil, "quic.clemente.io")
|
||||
Expect(client.hostname).To(Equal("quic.clemente.io:443"))
|
||||
|
||||
Reference in New Issue
Block a user