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

Second attempt at fixing #9

parent 54985c95
No related branches found
No related tags found
No related merge requests found
Pipeline #61063 failed
......@@ -132,12 +132,17 @@ func (a *ACME) acmeClient(ctx context.Context) (*acme.Client, error) {
// Register the account (accept TOS) if necessary. If the
// account is already registered we get a StatusConflict,
// which we can ignore.
acct, err := client.Register(ctx, ac, func(_ string) bool { return true })
_, 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) {
log.Printf("ACME account %s", acct.URI)
a.client = client
err = nil
}
// Fetch account info and display it.
if acct, err := client.GetReg(ctx, ""); err == nil {
log.Printf("ACME account %s", acct.URI)
}
return a.client, err
}
......
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