/tls/ -- add internal usable flag to simplify logic when https needs to be booted up

This commit is contained in:
Eugene Bujak
2019-02-19 15:21:38 +03:00
parent ba103f9825
commit 3c374b5940
3 changed files with 6 additions and 2 deletions

2
app.go
View File

@@ -179,7 +179,7 @@ func run(args options) {
address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.TLS.PortHTTPS))
// validate current TLS config and update warnings (it could have been loaded from file)
data := validateCertificates(config.TLS)
if data.WarningValidation != "" {
if !data.usable {
log.Fatal(data.WarningValidation)
os.Exit(1)
}