summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xenolf/lego/acme/error.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-03-13 12:54:22 -0400
committerGitHub <noreply@github.com>2017-03-13 12:54:22 -0400
commitc281ee3b61e8ab53ff118866d72618ae8cce582b (patch)
tree776e7bdf6c8bfbb9a1dee5976496ab065959991f /vendor/github.com/xenolf/lego/acme/error.go
parent3ada7a41a7fb13abef19dd63dc56b720900dbaa9 (diff)
downloadchat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.gz
chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.bz2
chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.zip
Updating server dependancies. Also adding github.com/jaytaylor/html2text and gopkg.in/gomail.v2 (#5748)
Diffstat (limited to 'vendor/github.com/xenolf/lego/acme/error.go')
-rw-r--r--vendor/github.com/xenolf/lego/acme/error.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/github.com/xenolf/lego/acme/error.go b/vendor/github.com/xenolf/lego/acme/error.go
index 6d7013cf1..e4bc934c2 100644
--- a/vendor/github.com/xenolf/lego/acme/error.go
+++ b/vendor/github.com/xenolf/lego/acme/error.go
@@ -8,7 +8,10 @@ import (
"strings"
)
-const tosAgreementError = "Must agree to subscriber agreement before any further actions"
+const (
+ tosAgreementError = "Must agree to subscriber agreement before any further actions"
+ invalidNonceError = "JWS has invalid anti-replay nonce"
+)
// RemoteError is the base type for all errors specific to the ACME protocol.
type RemoteError struct {
@@ -28,6 +31,12 @@ type TOSError struct {
RemoteError
}
+// NonceError represents the error which is returned if the
+// nonce sent by the client was not accepted by the server.
+type NonceError struct {
+ RemoteError
+}
+
type domainError struct {
Domain string
Error error
@@ -73,6 +82,10 @@ func handleHTTPError(resp *http.Response) error {
return TOSError{errorDetail}
}
+ if errorDetail.StatusCode == http.StatusBadRequest && strings.HasPrefix(errorDetail.Detail, invalidNonceError) {
+ return NonceError{errorDetail}
+ }
+
return errorDetail
}