Software /
code /
prosody
Comparison
core/certmanager.lua @ 7743:d018ffc9238c
core.certmanager: Translate "no start line" to something friendlier (thanks santiago)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 26 Nov 2016 20:08:48 +0100 |
parent | 7663:54424e981796 |
child | 8159:3850993a9bda |
comparison
equal
deleted
inserted
replaced
7742:18aad564cbc5 | 7743:d018ffc9238c |
---|---|
182 | 182 |
183 if not ctx then | 183 if not ctx then |
184 err = err or "invalid ssl config" | 184 err = err or "invalid ssl config" |
185 local file = err:match("^error loading (.-) %("); | 185 local file = err:match("^error loading (.-) %("); |
186 if file then | 186 if file then |
187 local typ; | |
187 if file == "private key" then | 188 if file == "private key" then |
189 typ = file; | |
188 file = user_ssl_config.key or "your private key"; | 190 file = user_ssl_config.key or "your private key"; |
189 elseif file == "certificate" then | 191 elseif file == "certificate" then |
192 typ = file; | |
190 file = user_ssl_config.certificate or "your certificate file"; | 193 file = user_ssl_config.certificate or "your certificate file"; |
191 end | 194 end |
192 local reason = err:match("%((.+)%)$") or "some reason"; | 195 local reason = err:match("%((.+)%)$") or "some reason"; |
193 if reason == "Permission denied" then | 196 if reason == "Permission denied" then |
194 reason = "Check that the permissions allow Prosody to read this file."; | 197 reason = "Check that the permissions allow Prosody to read this file."; |
195 elseif reason == "No such file or directory" then | 198 elseif reason == "No such file or directory" then |
196 reason = "Check that the path is correct, and the file exists."; | 199 reason = "Check that the path is correct, and the file exists."; |
197 elseif reason == "system lib" then | 200 elseif reason == "system lib" then |
198 reason = "Previous error (see logs), or other system error."; | 201 reason = "Previous error (see logs), or other system error."; |
202 elseif reason == "no start line" then | |
203 reason = "Check that the file contains a "..(typ or file); | |
199 elseif reason == "(null)" or not reason then | 204 elseif reason == "(null)" or not reason then |
200 reason = "Check that the file exists and the permissions are correct"; | 205 reason = "Check that the file exists and the permissions are correct"; |
201 else | 206 else |
202 reason = "Reason: "..tostring(reason):lower(); | 207 reason = "Reason: "..tostring(reason):lower(); |
203 end | 208 end |