Documentation ¶
Index ¶
- func AssertEveryTLSHello(t *testing.T, server *httptest.Server, clientTLSConfigFunc ptls.ConfigFunc)
- func AssertTLS(t *testing.T, r *http.Request, clientTLSConfigFunc ptls.ConfigFunc)
- func GetExpectedTLS13CipherNMapKeyExchangeInfoValue(cipher uint16) string
- func GetExpectedTLS13Ciphers() []uint16
- func RecordTLSHello(server *httptest.Server)
- func TLSTestServerWithCert(t *testing.T, handler http.HandlerFunc, certificate *tls.Certificate) (url string)
- func TestServerIPv4(t *testing.T, handler http.Handler, f func(*httptest.Server)) (*httptest.Server, []byte)
- func TestServerIPv6(t *testing.T, handler http.Handler, f func(*httptest.Server)) (*httptest.Server, []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEveryTLSHello ¶ added in v0.30.0
func AssertEveryTLSHello(t *testing.T, server *httptest.Server, clientTLSConfigFunc ptls.ConfigFunc)
AssertEveryTLSHello can be used to make assertions about the client's TLS configuration when a test expects the server to be dialed by the client, but does not expect that http requests will be performed (and thus assertions cannot be made during request handling). For example, a test could use this when the production code is only going to perform a tls.Dial to test the connection to the server, without making any actual requests.
func AssertTLS ¶
AssertTLS makes assertions on a particular incoming http request, assuming that the server was configured using RecordTLSHello.
func GetExpectedTLS13CipherNMapKeyExchangeInfoValue ¶ added in v0.29.0
GetExpectedTLS13CipherNMapKeyExchangeInfoValue returns the expected key exchange info value which is shown by nmap in parenthesis next to the cipher name for a non-FIPS build.
func GetExpectedTLS13Ciphers ¶ added in v0.29.0
func GetExpectedTLS13Ciphers() []uint16
GetExpectedTLS13Ciphers returns the expected TLS 1.3 cipher for a non-FIPS build.
func RecordTLSHello ¶
RecordTLSHello configures the server to record client TLS negotiation info onto each incoming request, so that the details of the client's TLS settings can be asserted upon during request handling using AssertTLS.
func TLSTestServerWithCert ¶ added in v0.30.0
func TLSTestServerWithCert(t *testing.T, handler http.HandlerFunc, certificate *tls.Certificate) (url string)
Types ¶
This section is empty.