MCPcopy
hub / github.com/caddyserver/caddy / HasCertificateForSubject

Method HasCertificateForSubject

modules/caddytls/tls.go:887–904  ·  view source on GitHub ↗
(subject string)

Source from the content-addressed store, hash-verified

885}
886
887func (t *TLS) HasCertificateForSubject(subject string) bool {
888 certCacheMu.RLock()
889 allMatchingCerts := certCache.AllMatchingCertificates(subject)
890 certCacheMu.RUnlock()
891 for _, cert := range allMatchingCerts {
892 // check if the cert is manually loaded by this config
893 if _, ok := t.loaded[cert.Hash()]; ok {
894 return true
895 }
896 // check if the cert is automatically managed by this config
897 for _, name := range cert.Names {
898 if _, ok := t.managing[name]; ok {
899 return true
900 }
901 }
902 }
903 return false
904}
905
906// keepStorageClean starts a goroutine that immediately cleans up all
907// known storage units if it was not recently done, and then runs the

Callers 2

ProvisionMethod · 0.95
automaticHTTPSPhase1Method · 0.80

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected