certman
certman copied to clipboard
RWLock is important?
The GetCertificate uses a RWLock
func (cm *CertMan) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
cm.mu.RLock()
defer cm.mu.RUnlock()
return cm.keyPair, nil
}
Is the lock is really needed? There is really no concurrent modifications. But the lock makes performance slower.