Skip to content

Commit

Permalink
Fix cert listener
Browse files Browse the repository at this point in the history
  • Loading branch information
mirel-dev committed Sep 24, 2024
1 parent ef9e0f2 commit 67ef861
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions snetd/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,19 @@ func newDaemon(components *Components) (daemon, error) {
func (d *daemon) start() {

var tlsConfig *tls.Config
var certReloader *CertReloader

certReloader := CertReloader{
CertFile: config.GetString(config.SSLCertPathKey),
KeyFile: config.GetString(config.SSLKeyPathKey),
mutex: new(sync.Mutex),
if config.GetString(config.SSLCertPathKey) != "" {
certReloader = &CertReloader{
CertFile: config.GetString(config.SSLCertPathKey),
KeyFile: config.GetString(config.SSLKeyPathKey),
mutex: new(sync.Mutex),
}
}

certReloader.Listen()
if certReloader != nil {
certReloader.Listen()
}

if d.autoSSLDomain != "" {
zap.L().Debug("enabling automatic SSL support")
Expand Down

0 comments on commit 67ef861

Please sign in to comment.