Crash on SSL cert/key error, describe issue in log

if serving ssl/tls fails, the cert/key files are checked to see if they
    are accessible, and any errors logged.
main
Harvey Tindall 5 months ago
parent 2be7baea4a
commit b75bd4d6c5
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -557,7 +557,16 @@ func start(asDaemon, firstCall bool) {
cert := app.config.Section("advanced").Key("tls_cert").MustString("")
key := app.config.Section("advanced").Key("tls_key").MustString("")
if err := SRV.ListenAndServeTLS(cert, key); err != nil {
app.err.Printf("Failure serving: %s", err)
filesToCheck := []string{cert, key}
fileNames := []string{"Certificate", "Key"}
for i, v := range filesToCheck {
_, err := os.Stat(v)
if err != nil {
app.err.Printf("SSL/TLS %s: %v\n", fileNames[i], err)
}
}
app.err.Fatalf("Failure serving with SSL/TLS: %s", err)
}
} else {
if err := SRV.ListenAndServe(); err != nil {

Loading…
Cancel
Save