aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-23 21:45:28 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-23 21:45:28 +0100
commita7af67e068e9dd035397f818a112a6755d51f54c (patch)
treeda943a5acc1b03dafd31827093608f4a6bd0c280
parentd8820b7284139c119debf99a43ea495aa1c2e7ba (diff)
wip
-rw-r--r--client.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/client.go b/client.go
index 84906b5..c1e0e91 100644
--- a/client.go
+++ b/client.go
@@ -239,7 +239,7 @@ func (c *Client) Authorize(a *Account, domain []string) error {
}
log.Println(az)
log.Println(ra)
- for _, ch := range az.Challenges {
+ for _, ch := range az {
switch ch.Status {
case StatusPending, StatusProcessing:
default:
@@ -252,7 +252,7 @@ func (c *Client) Authorize(a *Account, domain []string) error {
return err
}
-func (c *Client) Status(url string) (*Authorization, time.Duration, error) {
+func (c *Client) Status(url string) ([]Challenge, time.Duration, error) {
r := &Authorization{}
resp, err := http.Get(url)
if err != nil {
@@ -261,7 +261,8 @@ func (c *Client) Status(url string) (*Authorization, time.Duration, error) {
defer resp.Body.Close()
defer c.replyNonce(resp)
ns := parseHeader(resp)
- return r, ns.RetryAfter, json.NewDecoder(resp.Body).Decode(r)
+ err = json.NewDecoder(resp.Body).Decode(r)
+ return r.Challenges, ns.RetryAfter, err
}
////////////////////////////////////////////////////////////////////////