aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/acme/dim13.toml12
-rw-r--r--cmd/acme/main.go5
-rw-r--r--provider.go18
3 files changed, 24 insertions, 11 deletions
diff --git a/cmd/acme/dim13.toml b/cmd/acme/dim13.toml
index 687ae5d..f0711d6 100644
--- a/cmd/acme/dim13.toml
+++ b/cmd/acme/dim13.toml
@@ -11,12 +11,12 @@ directory = "https://acme-v01.api.letsencrypt.org/directory"
mail = "webmaster@dim13.org"
key = "private/webmaster.key"
-[desire.web]
-provider = "letsencrypt"
-account = "webmaster"
-altnames = [ "www.dim13.org", "mail.dim13.org", "git.dim13.org", "cvs.dim13.org", "dim13.org" ]
-key = "private/www_dim13_org.key"
-cert = "certs/www_dim13_org.pem"
+#[desire.web]
+#provider = "letsencrypt"
+#account = "webmaster"
+#altnames = [ "www.dim13.org", "mail.dim13.org", "git.dim13.org", "cvs.dim13.org", "dim13.org" ]
+#key = "private/www_dim13_org.key"
+#cert = "certs/www_dim13_org.pem"
[account.postmaster]
mail = "postmaster@dim13.org"
diff --git a/cmd/acme/main.go b/cmd/acme/main.go
index ea4151f..882a8b6 100644
--- a/cmd/acme/main.go
+++ b/cmd/acme/main.go
@@ -53,12 +53,11 @@ func prepare(conf *Config) error {
}
func satisfice(des *desire) error {
- if des.account.pending {
- log.Println("register pending account")
+ log.Println("register acc")
if err := des.provider.Register(des.account, des.account.Contacts); err != nil {
return err
}
- }
+ log.Println("register ok")
if err := des.provider.Authorize(des.account, des.Desire); err != nil {
return err
diff --git a/provider.go b/provider.go
index 8cdf8d6..f2ab923 100644
--- a/provider.go
+++ b/provider.go
@@ -6,6 +6,7 @@ import (
"errors"
"log"
"net/http"
+ "net/url"
"regexp"
"time"
)
@@ -46,10 +47,12 @@ func (p Provider) RoundTrip(req *http.Request) (*http.Response, error) {
p.nonces <- nonce
}
// not sure if it belongs here
+ /*
if resp.Header.Get("Content-Type") == mimeProblem {
defer resp.Body.Close()
return nil, problem(resp.Body)
}
+ */
return resp, nil
}
@@ -137,8 +140,19 @@ func (p *Provider) Register(s Signer, c Contacts) error {
Contact: c,
}
resp, err := p.post(p.NewReg, s, req)
- if err != nil && err.(Problem).Err != ErrMalformed {
- return err
+ if err != nil {
+ switch e := err.(type) {
+ case Problem:
+ log.Println("problem")
+ if e.Err != ErrMalformed {
+ return err
+ }
+ case *url.Error:
+ log.Println("url error")
+ default:
+ log.Println("other problem")
+ return err
+ }
}
ns := parseHeader(resp)