diff --git a/pkg/web/api.go b/pkg/web/api.go index 5be3a1312..e6cd508a9 100644 --- a/pkg/web/api.go +++ b/pkg/web/api.go @@ -47,7 +47,8 @@ type Api struct { } type APIServerStartOptions struct { - DiscardLogging bool + DiscardLogging bool + ConfigEnableCertManager bool } // New creates an api instance. @@ -112,6 +113,10 @@ func (a *Api) startServerWithOptions(options APIServerStartOptions) error { if options.DiscardLogging { a.e.Logger.SetOutput(io.Discard) } + if options.ConfigEnableCertManager { + conf.EnableCertManager = options.ConfigEnableCertManager + config.Set(conf) + } if conf.TLSCertificate != "" && conf.TLSKey != "" { return a.e.StartTLS(a.TLSAddress, conf.TLSCertificate, conf.TLSKey)