From 1bbfac4dff02e6c244539557f8905e14c69da700 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Wed, 16 Jan 2019 23:45:43 +0000 Subject: [PATCH] Add SetAccountURI method to ACME client Signed-off-by: James Munnelly --- third_party/crypto/acme/acme.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/third_party/crypto/acme/acme.go b/third_party/crypto/acme/acme.go index 86f1009c0..aa30062d4 100644 --- a/third_party/crypto/acme/acme.go +++ b/third_party/crypto/acme/acme.go @@ -90,6 +90,15 @@ type Client struct { accountURL string } +// SetAccountURL will set the account URL cached by the client. +// This should be used with caution, in order to reduce the number of calls +// made to the 'new-acct' endpoint in 'cacheAccountURL' +func (c *Client) SetAccountURL(url string) { + c.urlMu.Lock() + defer c.urlMu.Unlock() + c.accountURL = url +} + // Discover performs ACME server discovery using c.DirectoryURL. // // It caches successful result. So, subsequent calls will not result in