tls: Only update OCSP staple if field is not nil (fixes #1514)

This commit is contained in:
Matthew Holt 2017-03-13 09:30:58 -06:00
parent d5cc10f7aa
commit d85e90a7b4
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5

View File

@ -232,7 +232,7 @@ func UpdateOCSPStaples() {
// By this point, we've obtained the latest OCSP response.
// If there was no staple before, or if the response is updated, make
// sure we apply the update to all names on the certificate.
if lastNextUpdate.IsZero() || lastNextUpdate != cert.OCSP.NextUpdate {
if cert.OCSP != nil && (lastNextUpdate.IsZero() || lastNextUpdate != cert.OCSP.NextUpdate) {
log.Printf("[INFO] Advancing OCSP staple for %v from %s to %s",
cert.Names, lastNextUpdate, cert.OCSP.NextUpdate)
for _, n := range cert.Names {