Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto/acme/autocert: Certificate renewal does not check that the cache was updated #23569

Closed
morgabra opened this issue Jan 26, 2018 · 1 comment

Comments

@morgabra
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

N/A

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

N/A

What did you do?

https://github.com/golang/crypto/blob/master/acme/autocert/renewal.go#L105

We aren't checking for errors when attempting to update the cache after a cert renewal, which could lead to renewal certs getting lost on process restart, or multiple renewals getting triggered in a distributed context.

If a cache.Put() fails, we could flag the renew as dirty and schedule a new one in the near future. The renew flow could compare the in-memory cert with the cached cert and decide if it should try to update the cache again. (Or accept a renewed cert from the cache if another node was successful)

This has a nice benefit of ensuring some sort of eventual consistency in a distributed use case too.

@x1ddos
Copy link

x1ddos commented Jan 26, 2018

A future-proof link to the line in question:
https://github.com/golang/crypto/blob/0efb9460aaf800c6376acf625be2853bceac2e06/acme/autocert/renewal.go#L105

@odeke-em odeke-em changed the title acme/autocert: Cert renewal does not check that the cache was updated x/crypto/acme/autocert: Certificate renewal does not check that the cache was updated Jan 27, 2018
@gopherbot gopherbot added this to the Unreleased milestone Jan 27, 2018
@golang golang locked and limited conversation to collaborators Mar 6, 2019
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 28, 2022
Fixes golang/go#23569

Change-Id: I0f3ffab74acd2b69da0bbec2e0e90e42c2618071
GitHub-Last-Rev: e66a888d643dacc290ef58649dcc248d1925219e
GitHub-Pull-Request: golang/crypto#35
Reviewed-on: https://go-review.googlesource.com/98756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#23569

Change-Id: I0f3ffab74acd2b69da0bbec2e0e90e42c2618071
GitHub-Last-Rev: e66a888d643dacc290ef58649dcc248d1925219e
GitHub-Pull-Request: golang/crypto#35
Reviewed-on: https://go-review.googlesource.com/98756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LewiGoddard pushed a commit to LewiGoddard/crypto that referenced this issue Feb 16, 2023
Fixes golang/go#23569

Change-Id: I0f3ffab74acd2b69da0bbec2e0e90e42c2618071
GitHub-Last-Rev: e66a888d643dacc290ef58649dcc248d1925219e
GitHub-Pull-Request: golang/crypto#35
Reviewed-on: https://go-review.googlesource.com/98756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
BiiChris pushed a commit to BiiChris/crypto that referenced this issue Sep 15, 2023
Fixes golang/go#23569

Change-Id: I0f3ffab74acd2b69da0bbec2e0e90e42c2618071
GitHub-Last-Rev: e66a888
GitHub-Pull-Request: golang#35
Reviewed-on: https://go-review.googlesource.com/98756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants