Skip to content

Commit

Permalink
Pass on user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
evenh committed Apr 27, 2019
1 parent a2926c6 commit 696fe38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var serveCmd = &cobra.Command{
PrintErrorAndExit(errors.New("renewal threshold can't exceed 60 days"))
}

server.StartServer(&c)
server.StartServer(&c, UserAgent())
log.Infof("Listening on port %v", c.Port)
},
}
4 changes: 3 additions & 1 deletion server/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ type IssuerService struct {
}

// NewIssuerService constructs a new instance with a predefined config
func NewIssuerService(config *config.ServerConfig) *IssuerService {
func NewIssuerService(config *config.ServerConfig, userAgent string) *IssuerService {
certmagic.UserAgent = userAgent

issuer := new(IssuerService)
issuer.renewalEvents = make(chan string)

Expand Down
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
)

// StartServer spawns a server instance given a server config
func StartServer(config *config.ServerConfig) {
func StartServer(config *config.ServerConfig, userAgent string) {
s := grpc.NewServer()

issuerService := NewIssuerService(config)
issuerService := NewIssuerService(config, userAgent)

api.RegisterCertificateIssuerServer(s, issuerService)

Expand Down

0 comments on commit 696fe38

Please sign in to comment.