forked from seba/servefile
Enhanced error message for broken SSL keyfiles
This commit is contained in:
parent
2ce2a9c228
commit
8a040fbb75
|
@ -782,7 +782,10 @@ class ServeFile():
|
||||||
if self.useSSL:
|
if self.useSSL:
|
||||||
if not self._getKey():
|
if not self._getKey():
|
||||||
self.genKeyPair()
|
self.genKeyPair()
|
||||||
|
try:
|
||||||
server = SecureThreadedHTTPServer(self._getCert(), self._getKey(), (listenIp, self.port), handler, False)
|
server = SecureThreadedHTTPServer(self._getCert(), self._getKey(), (listenIp, self.port), handler, False)
|
||||||
|
except SSL.Error as e:
|
||||||
|
raise ServeFileException("SSL Error: Could not read SSL public/private key from file(s) (error was: \"%s\")" % (e[0][0][2],))
|
||||||
else:
|
else:
|
||||||
server = ThreadedHTTPServer((listenIp, self.port), handler, False)
|
server = ThreadedHTTPServer((listenIp, self.port), handler, False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue