Does not start TLS redirection on empty TLS config

This commit is contained in:
NXShock 2025-06-03 18:12:17 +05:00
parent e4f9a1a130
commit 59cb02bf94

View file

@ -38,11 +38,15 @@ func main() {
os.Exit(1) os.Exit(1)
} }
if len(config.TLS) > 0 {
err = app.restartTlsListener() err = app.restartTlsListener()
if err != nil { if err != nil {
slog.Error("Failed to start TLS listener", slog.String("err", err.Error())) slog.Error("Failed to start TLS listener", slog.String("err", err.Error()))
os.Exit(1) os.Exit(1)
} }
} else {
slog.Warn("TLS listener does not started because TLS redirection rules is empty")
}
go func() { go func() {
slog.Debug("Starting HTTP listener", slog.String("addr", config.HttpListenAddr)) slog.Debug("Starting HTTP listener", slog.String("addr", config.HttpListenAddr))