tlsserver

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func AssertTLS(t *testing.T, r *http.Request, clientTLSConfigFunc ptls.ConfigFunc)

AssertTLS makes assertions on a particular incoming http request, assuming that the server was configured using RecordTLSHello.

func GetExpectedTLS13CipherNMapKeyExchangeInfoValue added in v0.29.0

func GetExpectedTLS13CipherNMapKeyExchangeInfoValue(cipher uint16) string

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

func RecordTLSHello(server *httptest.Server)

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)

func TestServerIPv4 added in v0.30.0

func TestServerIPv4(t *testing.T, handler http.Handler, f func(*httptest.Server)) (*httptest.Server, []byte)

TestServerIPv4 returns a TLS-required server that listens at an IPv4 loopback.

func TestServerIPv6 added in v0.30.0

func TestServerIPv6(t *testing.T, handler http.Handler, f func(*httptest.Server)) (*httptest.Server, []byte)

TestServerIPv6 returns a TLS-required server that listens at an IPv6 loopback.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL