fix: ensure certStore is initialised when adding custom cert (#639)

Fixes: #612
This commit is contained in:
iain MacDonnell 2025-06-30 17:58:39 +01:00 committed by GitHub
parent fe127ed41c
commit 960f555790
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ func setTLSState(s TLSState) error {
isChanged = true
}
// parse pem to cert and key
if certStore == nil {
initCertStore()
}
err, _ := certStore.ValidateAndSaveCertificate(webSecureCustomCertificateName, s.Certificate, s.PrivateKey, true)
// warn doesn't matter as ... we don't know the hostname yet
if err != nil {