Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions internal/api/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (l *Listener) Run(ctx context.Context) error {
var errServe error

if l.config.TLSCertPath != "" && l.config.TLSKeyPath != "" {
l.logger.Info("Using TLS", "component", "listener", "key", l.config.TLSKeyPath, "cert", l.config.TLSCertPath)
errServe = server.ListenAndServeTLS(l.config.TLSCertPath, l.config.TLSKeyPath)
} else {
errServe = server.ListenAndServe()
Expand Down
5 changes: 4 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed under "BSD 3-Clause". See LICENSE file.
// SPDX-License-Identifier: BSD-3-Clause

package config

Expand Down Expand Up @@ -83,6 +83,9 @@ func NewConfigFromCLI(cli *CLI) (*Config, error) {
if errTLS != nil {
return &conf, fmt.Errorf("error loading the TLS configuration %w", errTLS)
}

conf.TLSKeyPath = cli.TLSKeyPath
conf.TLSCertPath = cli.TLSCertPath
}

conf.IcingaTLSConfig = &tls.Config{
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func main() {

// Central logger that we pass to the components
logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: config.MapLogLevel(cli.Loglevel)}))
slog.SetDefault(logger)

cfg, errConfig := config.NewConfigFromCLI(&cli)

Expand Down