From ae7c947ba525f108c0eb96be8662afc523a354e3 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 5 Jun 2018 09:54:03 +0200 Subject: [PATCH] Add user agent for ACME --- Gopkg.lock | 6 +++--- Gopkg.toml | 3 ++- acme/acme.go | 2 ++ provider/acme/provider.go | 2 ++ vendor/github.com/xenolf/lego/acme/client.go | 1 + vendor/github.com/xenolf/lego/acme/http.go | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 2e75a2d6b..9855ecbc7 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1243,6 +1243,7 @@ revision = "0c8571ac0ce161a5feb57375a9cdf148c98c0f70" [[projects]] + branch = "master" name = "github.com/xenolf/lego" packages = [ "acme", @@ -1280,8 +1281,7 @@ "providers/dns/route53", "providers/dns/vultr" ] - revision = "fefeb24353e513a985358d4a7746b2467ac05e31" - version = "v1.0.0" + revision = "7fedfd1388f016c7ca7ed92a7f2024d06a7e20d8" [[projects]] branch = "master" @@ -1679,6 +1679,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "a6acf97e7459604ff987fa8af4520a1660ad8871df0db131ae3e9442574460b0" + inputs-digest = "ac06fad81167510635546d4e5500b938d61f2eb999bf04d5520d7967b9621f0d" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 64fcca0e9..bf27e331d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -181,8 +181,9 @@ name = "github.com/vulcand/oxy" [[constraint]] + branch = "master" name = "github.com/xenolf/lego" - version = "1.0.0" +# version = "1.0.0" [[constraint]] name = "google.golang.org/grpc" diff --git a/acme/acme.go b/acme/acme.go index d9ef0fe4a..3804141aa 100644 --- a/acme/acme.go +++ b/acme/acme.go @@ -25,6 +25,7 @@ import ( "github.com/containous/traefik/safe" "github.com/containous/traefik/tls/generate" "github.com/containous/traefik/types" + "github.com/containous/traefik/version" "github.com/eapache/channels" "github.com/xenolf/lego/acme" legolog "github.com/xenolf/lego/log" @@ -63,6 +64,7 @@ type ACME struct { } func (a *ACME) init() error { + acme.UserAgent = fmt.Sprintf("containous-traefik/%s", version.Version) if a.ACMELogging { legolog.Logger = fmtlog.New(os.Stderr, "legolog: ", fmtlog.LstdFlags) } else { diff --git a/provider/acme/provider.go b/provider/acme/provider.go index 1a34b5a91..632017f04 100644 --- a/provider/acme/provider.go +++ b/provider/acme/provider.go @@ -22,6 +22,7 @@ import ( "github.com/containous/traefik/safe" traefikTLS "github.com/containous/traefik/tls" "github.com/containous/traefik/types" + "github.com/containous/traefik/version" "github.com/pkg/errors" "github.com/xenolf/lego/acme" legolog "github.com/xenolf/lego/log" @@ -98,6 +99,7 @@ func (p *Provider) SetConfigListenerChan(configFromListenerChan chan types.Confi } func (p *Provider) init() error { + acme.UserAgent = fmt.Sprintf("containous-traefik/%s", version.Version) if p.ACMELogging { legolog.Logger = fmtlog.New(os.Stderr, "legolog: ", fmtlog.LstdFlags) } else { diff --git a/vendor/github.com/xenolf/lego/acme/client.go b/vendor/github.com/xenolf/lego/acme/client.go index 75c8fb54b..a9e346089 100644 --- a/vendor/github.com/xenolf/lego/acme/client.go +++ b/vendor/github.com/xenolf/lego/acme/client.go @@ -822,6 +822,7 @@ func validate(j *jws, domain, uri string, c challenge) error { log.Printf("[INFO][%s] The server validated our request", domain) return nil case "pending": + case "processing": case "invalid": return handleChallengeError(chlng) default: diff --git a/vendor/github.com/xenolf/lego/acme/http.go b/vendor/github.com/xenolf/lego/acme/http.go index b93e53445..f45e7f871 100644 --- a/vendor/github.com/xenolf/lego/acme/http.go +++ b/vendor/github.com/xenolf/lego/acme/http.go @@ -155,6 +155,6 @@ func postJSON(j *jws, uri string, reqBody, respBody interface{}) (http.Header, e // userAgent builds and returns the User-Agent string to use in requests. func userAgent() string { - ua := fmt.Sprintf("%s (%s; %s) %s %s", defaultGoUserAgent, runtime.GOOS, runtime.GOARCH, ourUserAgent, UserAgent) + ua := fmt.Sprintf("%s %s (%s; %s) %s", UserAgent, ourUserAgent, runtime.GOOS, runtime.GOARCH, defaultGoUserAgent) return strings.TrimSpace(ua) }