Documentation
¶
Overview ¶
Package testca mints ephemeral CA and leaf certificates for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientTLS ¶
func ClientTLS(leaf *Cert, cas ...*Cert) tls.Certificate
ClientTLS builds a tls.Certificate presenting leaf then the given CAs, for use as an http client certificate (so the server sees the full chain).
func Expired ¶
func Expired(c *x509.Certificate)
Expired is an Issue mutator that produces an already-expired certificate.
func RequireLoopback ¶ added in v0.1.1
RequireLoopback skips the test if the environment cannot bind a loopback socket (e.g. a sandbox that blocks listening), so httptest-based tests do not panic where networking is unavailable.
Types ¶
type Cert ¶
type Cert struct {
Cert *x509.Certificate
Key *ecdsa.PrivateKey
DER []byte
PEM []byte
TLS tls.Certificate
}
Cert bundles a certificate with its key and common encodings.
Click to show internal directories.
Click to hide internal directories.