aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challange_dns.go2
-rw-r--r--challange_http.go2
-rw-r--r--challange_tls_sni.go11
-rw-r--r--challenge.go8
-rw-r--r--errors.go4
5 files changed, 21 insertions, 6 deletions
diff --git a/challange_dns.go b/challange_dns.go
index 8d2a213..c0480a8 100644
--- a/challange_dns.go
+++ b/challange_dns.go
@@ -1 +1,3 @@
package acme
+
+// not implemented
diff --git a/challange_http.go b/challange_http.go
index bcc4691..b1fe9c0 100644
--- a/challange_http.go
+++ b/challange_http.go
@@ -12,7 +12,7 @@ import (
const wellKnown = `/.well-known/acme-challenge/`
func init() {
- registerChallenge(ChallengeHTTP)
+ registerSolver(ChallengeHTTP)
}
type httpChallenge struct {
diff --git a/challange_tls_sni.go b/challange_tls_sni.go
index 8d2a213..5c03fce 100644
--- a/challange_tls_sni.go
+++ b/challange_tls_sni.go
@@ -1 +1,12 @@
package acme
+
+import "errors"
+
+var errZ = errors.New("invalid Z")
+
+func SNIName(z string) (string, error) {
+ if len(z) != 64 {
+ return "", errZ
+ }
+ return z[0:32] + "." + z[32:64] + ".acme.invalid", nil
+}
diff --git a/challenge.go b/challenge.go
index 2571012..dc4a5eb 100644
--- a/challenge.go
+++ b/challenge.go
@@ -11,10 +11,12 @@ type Solver interface {
Abort() error
}
-var canSolve = make(map[ChallengeType]bool)
-var errTimeOut = errors.New("time out")
+var (
+ canSolve = make(map[ChallengeType]bool)
+ errTimeOut = errors.New("time out")
+)
-func registerChallenge(c ChallengeType) {
+func registerSolver(c ChallengeType) {
canSolve[c] = true
}
diff --git a/errors.go b/errors.go
index 60eb636..c38bbf8 100644
--- a/errors.go
+++ b/errors.go
@@ -6,7 +6,7 @@ var (
ErrBadCSR = errors.New("CSR is unacceptable")
ErrBadNonce = errors.New("Client sent an unacceptable anti-replay nonce")
ErrConnection = errors.New("Server could not connect to the client for DV")
- ErrDnssec = errors.New("Server could not validate a DNSSEC signed domain")
+ ErrDNSSEC = errors.New("Server could not validate a DNSSEC signed domain")
ErrMalformed = errors.New("Request message was malformed")
ErrServerInternal = errors.New("Server experienced an internal error")
ErrTLS = errors.New("Server experienced a TLS error during DV")
@@ -19,7 +19,7 @@ var urnErrors = map[string]error{
"urn:acme:error:badCSR": ErrBadCSR,
"urn:acme:error:badNonce": ErrBadNonce,
"urn:acme:error:connection": ErrConnection,
- "urn:acme:error:dnssec": ErrDnssec,
+ "urn:acme:error:dnssec": ErrDNSSEC,
"urn:acme:error:malformed": ErrMalformed,
"urn:acme:error:serverInternal": ErrServerInternal,
"urn:acme:error:tls": ErrTLS,