aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-22 18:43:30 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-22 18:43:30 +0100
commit84497cce8f0f89a74c09ba9ecd71e30af8f571f0 (patch)
treed58690ca8a6fca3e0cba2fe941842180dba6e917 /client.go
parent160a6c8f3ba267c94f4f75de1e33fe544f15769c (diff)
Add thumb
Diffstat (limited to 'client.go')
-rw-r--r--client.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/client.go b/client.go
index f8c5aab..170f007 100644
--- a/client.go
+++ b/client.go
@@ -216,11 +216,13 @@ func (c *Client) Authorize(a *Account, domain []string) error {
switch resp.StatusCode {
case http.StatusCreated:
for _, ch := range r.Challenges {
- if ch.Type == ChallengeHTTP {
+ if canSolve[ch.Type] {
+ t, _ := Thumb(ch.Token, a.PrivKey)
ans := &Challenge{
- Resource: ResChallenge,
- Type: ch.Type,
- Token: ch.Token,
+ Resource: ResChallenge,
+ Type: ch.Type,
+ Token: ch.Token,
+ KeyAuthorization: t,
}
_, err = c.post(ch.URI, a, ans)
}