aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-27 13:49:30 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-11-27 13:49:30 +0100
commit23282f058e68aac8bf29216faf90d7f27f6ad8c8 (patch)
treebfa6bdaf0bf0ec55f69c0b9bab45d3aa8d1f36d9
parentaefd5527a48501e882d22fd00812d2c8801e8fbe (diff)
Add errors
-rw-r--r--client.go5
-rw-r--r--cmd/acme/main.go2
-rw-r--r--errors.go15
3 files changed, 22 insertions, 0 deletions
diff --git a/client.go b/client.go
index 3674db2..8759ad1 100644
--- a/client.go
+++ b/client.go
@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"io/ioutil"
+ "log"
"net/http"
)
@@ -25,6 +26,10 @@ func Post(uri string, v interface{}) error {
if err != nil {
return err
}
+ log.Println(string(body))
+ return nil
+ // premature debug abort
+
_, err = http.Post(uri, "application/jose+json", bytes.NewReader(body))
if err != nil {
return err
diff --git a/cmd/acme/main.go b/cmd/acme/main.go
index 4e57a23..c5ed22b 100644
--- a/cmd/acme/main.go
+++ b/cmd/acme/main.go
@@ -12,4 +12,6 @@ func main() {
log.Fatal(err)
}
log.Println(dir)
+
+ acme.Post(dir.NewReg, acme.Registration{})
}
diff --git a/errors.go b/errors.go
new file mode 100644
index 0000000..ce04bf6
--- /dev/null
+++ b/errors.go
@@ -0,0 +1,15 @@
+package acme
+
+import "errors"
+
+var Errors = map[string]error{
+ "badCSR": errors.New("The CSR is unacceptable (e.g., due to a short key)"),
+ "badNonce": errors.New("The client sent an unacceptable anti-replay nonce"),
+ "connection": errors.New("The server could not connect to the client for DV"),
+ "dnssec": errors.New("The server could not validate a DNSSEC signed domain"),
+ "malformed": errors.New("The request message was malformed"),
+ "serverInternal": errors.New("The server experienced an internal error"),
+ "tls": errors.New("The server experienced a TLS error during DV"),
+ "unauthorized": errors.New("The client lacks sufficient authorization"),
+ "unknownHost": errors.New("The server could not resolve a domain name"),
+}