diff --git a/acme/jws.go b/acme/jws.go index 1fc9eaba..ed69f52e 100644 --- a/acme/jws.go +++ b/acme/jws.go @@ -9,14 +9,10 @@ import ( "fmt" "net/http" - "errors" "gopkg.in/square/go-jose.v1" - "time" + "errors" ) -const TRY_COUNT = 10 -const RETRY_PAUSE = time.Second - type jws struct { directoryURL string privKey crypto.PrivateKey @@ -101,24 +97,14 @@ func (j *jws) getNonce() error { func (j *jws) Nonce() (string, error) { nonce := "" if len(j.nonces) == 0 { - for i := 0; i < TRY_COUNT; i++ { - err := j.getNonce() - if err != nil { - return nonce, err - } - if len(j.nonces) != 0 { - // get nonce ok and can continue - break - } - if i < TRY_COUNT-1 { - time.Sleep(RETRY_PAUSE) - } + err := j.getNonce() + if err != nil { + return nonce, err } } if len(j.nonces) == 0 { return "", errors.New("Can't get nonce") } - nonce, j.nonces = j.nonces[len(j.nonces)-1], j.nonces[:len(j.nonces)-1] return nonce, nil }