Enable intermediate CA Certificates

Signed-off-by: Jonas Wagner <jwagner@knoppiks.de>
This commit is contained in:
Jonas Wagner
2023-07-10 08:59:37 +02:00
parent 4c1ac9bd4b
commit 02304047cf
5 changed files with 58 additions and 21 deletions

View File

@@ -34,7 +34,12 @@ type SetFactory interface {
SetFactory(tls TLSFactory)
}
// Deprecated: Use NewListener2 instead as it supports intermediate CAs
func NewListener(l net.Listener, storage TLSStorage, caCert *x509.Certificate, caKey crypto.Signer, config Config) (net.Listener, http.Handler, error) {
return NewListener2(l, storage, []*x509.Certificate{caCert}, caKey, config)
}
func NewListener2(l net.Listener, storage TLSStorage, caCert []*x509.Certificate, caKey crypto.Signer, config Config) (net.Listener, http.Handler, error) {
if config.CN == "" {
config.CN = "dynamic"
}