aboutsummaryrefslogtreecommitdiff
path: root/acme/http.go
AgeCommit message (Collapse)Author
2025-11-12acme: pass context to requestSean Liao
Fixes golang/go#30183 Change-Id: Ic02b34bc87b9465f5c05b2ef5bec157c58809a91 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/719002 Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-11acme: use built-in max/min to simplify the codecuishuang
Change-Id: I6ba8d07b9e53b01f25f4c1c8eac629aaa47de3a1 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/664836 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-06-26all: bump go.mod version and drop compatibility shimsFilippo Valsorda
Also, remove the legacy import annotations. Fixes golang/go#68147 Change-Id: Ibfcc9322f27224c0ba92ea42cd56912a7d8783fd Reviewed-on: https://go-review.googlesource.com/c/crypto/+/594256 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-10-12all: use automatic RFC linkingAxel Wagner
pkgsite automatically links /RFC \d+/ to the mentioned RFC. Insert a bunch of spaces into doc-comments for that to match. Change-Id: I01834d7573428563f21c37e43316442e148dd8c4 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/442055 Reviewed-by: Joedian Reid <joedian@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-09-19all: replace io/ioutil with io and os packagecui fliter
For golang/go#45557 Change-Id: I447530cc66896aef7a8d528ccb8d095b80e3cf47 GitHub-Last-Rev: 5f385ff46487ac318bd1147cdbbd26bb0ffd0426 GitHub-Pull-Request: golang/crypto#230 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/430797 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Meng Zhuo <mzh@golangcn.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-17acme: fix deadlock when Client.Key is nilRoland Shoemaker
When methods that use POSTs are called on a acme.Client which has a nil Key field it will cause a deadlock due to an infinite loop in the code that looks up the account KID. This change adds a check for the key being nil, and errors out if that is the case. Also adds a test for this behavior. Fixes golang/go#38790 Change-Id: I65ff6bbbade7ed2d85306895904a976089730bbf Reviewed-on: https://go-review.googlesource.com/c/crypto/+/233164 Trust: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-01acme: update existing methods for RFC 8555Alex Vaghin
This adds RFC support to the existing methods which, in conjunction with the new order based methods implemented in golang.org/cl/192779, completes a Client capable of obtaining certificates from RFC compliant CAs. Updates golang/go#21081 Change-Id: I3aabc50928d3e4e49ee202eb6695135d5ad86821 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/194379 Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-09-27acme: support RFC 8555 account managementAlex Vaghin
Most important change in this CL is that Client is now able to correctly format and sign requests in KID form with a valid "kid" value. According to the RFC, most requests must include KID field in the protected head of JWS requests. The KID value is the account identity provided by the CA during registration. The KID value is also the Account URL. Hence, the CL is tied to account management. Updates golang/go#21081 Change-Id: I13f51e1fc52db7596eb933b47fa2014beb93c1ab Reviewed-on: https://go-review.googlesource.com/c/crypto/+/191602 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-26acme: add KID variant to jwsEncodeJSONAlex Vaghin
RFC8555 requires that most requests contain "kid" field in the protected header. The JWK version is still used for new account creation and certificate revocation requests. Previously, in earlier drafts JWK variant was used exclusively. While JWK is computed based off the account public key, the new "kid" field takes literal value of the Account URL provided by the CA during a new registration. The actual support for KID-based JWS requests in Client will be added in a follow up CL. For what concerns the existing behaviour of JWS requests, a new field "url" is added to the protected header. Before: {"alg":"...", "jwk":"...", "nonce":"..."} After: {"alg":"...", "jwk":"...", "nonce":"...", "url":"..."} where the new field takes a value of the target request URL. This still works for CAs supporting pre-RFC protocol versions. Updates golang/go#21081 Change-Id: I460cfcd3dfdfe7fe3009a92a0a8a709fa07d0e7a Reviewed-on: https://go-review.googlesource.com/c/crypto/+/191601 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-06-21acme: send User-Agent and add Client.UserAgentFilippo Valsorda
This is useful to CAs, to identify and reach out to problematic clients. Fixes golang/go#24496 Change-Id: I944fc8178c8fa8acaf3854e9c125d3af0364a4fb Reviewed-on: https://go-review.googlesource.com/c/crypto/+/183267 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-21acme: consistently return original errors from retriesAlex Vaghin
The retry logic returns an "acme: no more retries for ..." error in some cases, while *Error type in others. This change makes retries always return the last error as received from the CA server, if available. No change in returned values of successful requests. Change-Id: I3df2cb332a3e2739bba457c0ee50d7ca5bd836d9 Reviewed-on: https://go-review.googlesource.com/119975 Reviewed-by: Maciej Dębski <maciejd@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-02acme: clarify retries and backoff algorithmAlex Vaghin
There's been some confusion about failed request retries. Rightfully so: some requests are retried, others are not. This change attempts to clarify the issue and unify backoff usage in all Client's methods by introducing a new exported optional field RetryBackoff and adding retry logic where missing. Also, updates golang/go#22457. Change-Id: Ied434edf998d52925a48b6b3b2407d45a6e9d2ee Reviewed-on: https://go-review.googlesource.com/109615 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>