Skip to content
Snippets Groups Projects
Commit 54985c95 authored by ale's avatar ale
Browse files

Print ACME account URL on client creation

Fixes issue #9.
parent 8979e951
No related branches found
No related tags found
No related merge requests found
Pipeline #61062 passed
...@@ -132,8 +132,9 @@ func (a *ACME) acmeClient(ctx context.Context) (*acme.Client, error) { ...@@ -132,8 +132,9 @@ func (a *ACME) acmeClient(ctx context.Context) (*acme.Client, error) {
// Register the account (accept TOS) if necessary. If the // Register the account (accept TOS) if necessary. If the
// account is already registered we get a StatusConflict, // account is already registered we get a StatusConflict,
// which we can ignore. // which we can ignore.
_, err = client.Register(ctx, ac, func(_ string) bool { return true }) acct, err := client.Register(ctx, ac, func(_ string) bool { return true })
if ae, ok := err.(*acme.Error); err == nil || err == acme.ErrAccountAlreadyExists || (ok && ae.StatusCode == http.StatusConflict) { if ae, ok := err.(*acme.Error); err == nil || err == acme.ErrAccountAlreadyExists || (ok && ae.StatusCode == http.StatusConflict) {
log.Printf("ACME account %s", acct.URI)
a.client = client a.client = client
err = nil err = nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment