Documentation
¶
Overview ¶
Package store provides various implementations of stores of TLS certificates that can be plugged into server libraries that accept tls.Config structs (e.g. the http and grpc packages).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReloadingFileStore ¶
type ReloadingFileStore struct {
// contains filtered or unexported fields
}
ReloadingFileStore is a Store that will return the same tls.Certificate for all incoming TLS handshakes. The certificate is periodically regenerated by loading the key material from a well known path.
func NewReloadingFileStore ¶
func NewReloadingFileStore(opts ReloadingFileStoreOpts) (*ReloadingFileStore, error)
NewReloadingFileStore returns a pointer to a new ReloadingFileStore.
func (*ReloadingFileStore) GetCertificateFunc ¶
func (s *ReloadingFileStore) GetCertificateFunc() func(info *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificateFunc implements Store by returning a function that returns the currently cached value of the tls.Certificate.
type ReloadingFileStoreOpts ¶
ReloadingFileStoreOpts are options for a ReloadingFileStore.
type Store ¶
type Store interface {
// GetCertificateFunc returns a function that will return the appropriate
// tls.Certificate based on the incoming tls.ClientHelloInfo.
GetCertificateFunc() func(info *tls.ClientHelloInfo) (*tls.Certificate, error)
// Run starts the Store.
Run(ctx context.Context) error
}
Store is a cache of tls.Certificates.