Skip to content
File

Blob: spec/cipher/provider.go

go18 lines
1package cipher
2 
3import (
4 "context"
5 "crypto/tls"
6)
7 
8type CertProviderFunc func(*tls.ClientHelloInfo) (*tls.Certificate, error)
9 
10type OnHandshakeFunc func(sni string)
11 
12type CertProvider interface {
13 Initialize(ctx context.Context) error
14 GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)
15 GetCertificateWithContext(context.Context, *tls.ClientHelloInfo) (*tls.Certificate, error)
16 OnHandshake(OnHandshakeFunc)
17}