aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/client.go b/client.go
index a394b66..ae3d81e 100644
--- a/client.go
+++ b/client.go
@@ -3,7 +3,7 @@ package acme
import (
"bytes"
"encoding/json"
- "errors"
+ "fmt"
"log"
"net/http"
"net/textproto"
@@ -34,15 +34,15 @@ func (s *Status) UnmarshalJSON(b []byte) error {
*s = st
return nil
}
- return errors.New("unknown status")
+ return fmt.Errorf("unknown status %v", string(b))
}
-type Signer interface {
+type NonceSigner interface {
Sign([]byte) ([]byte, error)
parseNonce(*http.Response)
}
-func Get(s Signer, uri string, v interface{}) error {
+func Get(s NonceSigner, uri string, v interface{}) error {
resp, err := http.Get(uri)
if err != nil {
return err
@@ -67,7 +67,7 @@ func Get(s Signer, uri string, v interface{}) error {
// Request issuance POST new-cert 201 -> cert
// Check for new cert GET cert 200
-func Post(s Signer, uri string, v interface{}) (*http.Response, error) {
+func Post(s NonceSigner, uri string, v interface{}) (*http.Response, error) {
body, err := json.Marshal(v)
if err != nil {
return nil, err