ocspstapling

package module
v0.0.0-...-33e72e6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 10 Imported by: 0

README

ocspstapling

Small package to provide ocspstapling in go http server

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCertificate        = errors.New("invalid certificate provided")
	ErrNoOCSPServerDefined       = errors.New("no OCSP Server defined")
	ErrCouldNotCreateOCSPRequest = errors.New("could not create OCSP request")
	ErrCouldNotPostOCSPRequest   = errors.New("could not post OCSP request")
	ErrCouldNotReadOCSPResponse  = errors.New("could not read OCSP response")
	ErrCouldNotCloseBody         = errors.New("could not close response body")
	ErrCouldNotParseResponse     = errors.New("response is not a valid ocsp response")
)

Functions

This section is empty.

Types

type Stapling

type Stapling struct {
	// contains filtered or unexported fields
}

func NewStapling

func NewStapling(ctx context.Context, certificate tls.Certificate) *Stapling

NewStapling creates a new Stapling struct. The context is provided for early cancellation. The certificate is stored inside the Stapling struct. Certificate with the OCSP staple included can be retrieved by using the stapling.Certificate() method.

func (*Stapling) Certificate

func (s *Stapling) Certificate() (*tls.Certificate, error)

Certificate returns a copy of the internal certificate as a pointer. At the moment error is always nil, but included to satisfy the GetCertificate function from tls.Config return value

func (*Stapling) RunOCSPRenewal

func (s *Stapling) RunOCSPRenewal(ctx context.Context)

RunOCSPRenewal will run for-ever until ctx is cancelled. This function renews the OCSP staple in the internal certificate Every time the OCSP issuer server indicates the staple should be refreshed.

Jump to

Keyboard shortcuts

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