()
| 121 | } |
| 122 | |
| 123 | func NewCertCache() *certCache { |
| 124 | cache, err := lru.NewARC(1024) |
| 125 | if err != nil { |
| 126 | panic(err) |
| 127 | } |
| 128 | |
| 129 | return &certCache{ |
| 130 | cache: cache, |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func (c *certCache) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) { |
| 135 | c.lock.Lock() |