certman icon indicating copy to clipboard operation
certman copied to clipboard

RWLock is important?

Open stokito opened this issue 2 years ago • 0 comments

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.

stokito avatar Jun 22 '23 21:06 stokito