MCPcopy
hub / github.com/puma/puma-dev / GetCertificate

Method GetCertificate

dev/ssl.go:134–152  ·  view source on GitHub ↗
(clientHello *tls.ClientHelloInfo)

Source from the content-addressed store, hash-verified

132}
133
134func (c *certCache) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) {
135 c.lock.Lock()
136 defer c.lock.Unlock()
137
138 name := clientHello.ServerName
139
140 if val, ok := c.cache.Get(name); ok {
141 return val.(*tls.Certificate), nil
142 }
143
144 cert, err := makeCert(CACert, name)
145 if err != nil {
146 return nil, err
147 }
148
149 c.cache.Add(name, cert)
150
151 return cert, nil
152}
153
154func makeCert(
155 parent *tls.Certificate,

Callers

nothing calls this directly

Calls 2

makeCertFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected