-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
acme: send User-Agent and add Client.UserAgent
This is useful to CAs, to identify and reach out to problematic clients. Fixes golang/go#24496 Change-Id: I944fc8178c8fa8acaf3854e9c125d3af0364a4fb Reviewed-on: https://go-review.googlesource.com/c/crypto/+/183267 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- Loading branch information
1 parent
1e4ef05
commit 971ff6c
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2019 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build go1.12 | ||
|
||
package acme | ||
|
||
import "runtime/debug" | ||
|
||
func init() { | ||
// Set packageVersion if the binary was built in modules mode and x/crypto | ||
// was not replaced with a different module. | ||
info, ok := debug.ReadBuildInfo() | ||
if !ok { | ||
return | ||
} | ||
for _, m := range info.Deps { | ||
if m.Path != "golang.org/x/crypto" { | ||
continue | ||
} | ||
if m.Replace == nil { | ||
packageVersion = m.Version | ||
} | ||
break | ||
} | ||
} |