Auto update newt

This commit is contained in:
Owen
2026-05-28 15:38:08 -07:00
parent 6ccfe96e69
commit 42cb8e7908
6 changed files with 306 additions and 0 deletions
+16
View File
@@ -931,3 +931,19 @@ func loadClientCertificate(p12Path string) (*tls.Config, error) {
RootCAs: rootCAs,
}, nil
}
// BuildTLSConfig creates a *tls.Config from the provided certificate files.
// Pass empty strings / nil slice for fields that are not used.
// Returns nil, nil when no TLS credentials are provided.
func BuildTLSConfig(certFile, keyFile string, caFiles []string, pkcs12File string) (*tls.Config, error) {
c := &Client{
tlsConfig: TLSConfig{
ClientCertFile: certFile,
ClientKeyFile: keyFile,
CAFiles: caFiles,
PKCS12File: pkcs12File,
},
config: &Config{},
}
return c.setupTLS()
}