Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions acme/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import (
"net/http"
"runtime"
"strings"
"sync"
"time"
)

// UserAgent (if non-empty) will be tacked onto the User-Agent string in requests.
var UserAgent string

var ConcurrentChallengesNoncesOrderEnsurer sync.Mutex

// HTTPClient is an HTTP client with a reasonable timeout value.
var HTTPClient = http.Client{
Transport: &http.Transport{
Expand Down Expand Up @@ -104,6 +107,9 @@ func postJSON(j *jws, uri string, reqBody, respBody interface{}) (http.Header, e
return nil, errors.New("Failed to marshal network message...")
}

ConcurrentChallengesNoncesOrderEnsurer.Lock()
defer ConcurrentChallengesNoncesOrderEnsurer.Unlock()

resp, err := j.post(uri, jsonBytes)
if err != nil {
return nil, fmt.Errorf("Failed to post JWS message. -> %v", err)
Expand Down