selfsigned

package
v1.12.3-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert struct {
	// Path to the SSL certificates.
	CACertPath, CertPath string

	// Path to the private keys for the SSL certificates.
	CAKeyPath, KeyPath string
}

func NewSelfSignedCert

func NewSelfSignedCert(t *testing.T, opts ...CertOpt) *Cert

func (*Cert) ClientTLSConfig

func (c *Cert) ClientTLSConfig(t *testing.T, insecure, addCert bool) *tls.Config

func (*Cert) ServerTLSConfig

func (c *Cert) ServerTLSConfig(t *testing.T) *tls.Config

type CertOpt

type CertOpt func(*CertOptions)

func WithCASubject

func WithCASubject(organization, commonName string) CertOpt

func WithCombinedFile

func WithCombinedFile() CertOpt

func WithDNSName

func WithDNSName(dnsName string) CertOpt

func WithIPAddr

func WithIPAddr(ipAddr net.IP) CertOpt

func WithNoDefaultIPAddrs

func WithNoDefaultIPAddrs() CertOpt

func WithNotAfter

func WithNotAfter(notAfter time.Time) CertOpt

func WithNotBefore

func WithNotBefore(notBefore time.Time) CertOpt

type CertOptions

type CertOptions struct {
	// DNSNames for cert
	DNSNames []string

	// IP Addresses for cert
	IPAddrs []net.IP

	// SkipDefaultIPAddrs indicates if the default IPAddrs should be skipped if IPAddrs is not set.
	SkipDefaultIPAddrs bool

	// NotBefore for certificate
	NotBefore time.Time

	// NotAfter for certificate
	NotAfter time.Time

	// CombinedFile indicates if the certificate and key should be combined into a single file
	CombinedFile bool

	// CAOrganization sets the CA certificate's Subject.Organization field
	CAOrganization string

	// CACommonName sets the CA certificate's Subject.CommonName field
	CACommonName string
}

Jump to

Keyboard shortcuts

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