+ local file;\r
+ file = err:match("^error loading (.-) %(");\r
+ if file then\r
+ if file == "private key" then\r
+ file = sslctx.key or "your private key";\r
+ elseif file == "certificate" then\r
+ file = sslctx.certificate or "your certificate file";\r
+ end\r
+ local reason = err:match("%((.+)%)$") or "some reason";\r
+ if reason == "Permission denied" then\r
+ reason = "Check that the permissions allow Prosody to read this file.";\r
+ elseif reason == "No such file or directory" then\r
+ reason = "Check that the path is correct, and the file exists.";\r
+ elseif reason == "system lib" then\r
+ reason = "Previous error (see logs), or other system error.";\r
+ else\r
+ reason = "Reason: "..tostring(reason or "unknown"):lower();\r
+ end\r
+ log("error", "SSL/TLS: Failed to load %s: %s", file, reason);\r
+ else\r
+ log("error", "SSL/TLS: Error initialising for port %d: %s", serverport, err );\r
+ end\r