1
0

chore: refactor; unify vault mutex usage with wrappers;

This commit is contained in:
Atanas Janeshliev
2025-07-01 13:20:23 +02:00
parent 26cc6169fa
commit e9b1befae4
2 changed files with 7 additions and 28 deletions

View File

@ -30,10 +30,7 @@ import (
// If CertPEMPath is set, it will attempt to read the certificate from the file.
// Otherwise, or on read/validation failure, it will return the certificate from the vault.
func (vault *Vault) GetBridgeTLSCert() ([]byte, []byte) {
vault.lock.RLock()
defer vault.lock.RUnlock()
certs := vault.getUnsafe().Certs
certs := vault.getSafe().Certs
if certPath, keyPath := certs.CustomCertPath, certs.CustomKeyPath; certPath != "" && keyPath != "" {
if certPEM, keyPEM, err := readPEMCert(certPath, keyPath); err == nil {