浏览代码

HUE-2856 [desktop] Runcpserver logging for SSL cert or key failure

krish 10 年之前
父节点
当前提交
0d31ac0
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      desktop/core/src/desktop/lib/wsgiserver.py

+ 7 - 3
desktop/core/src/desktop/lib/wsgiserver.py

@@ -1672,12 +1672,16 @@ class CherryPyWSGIServer(object):
               ctx.set_passwd_cb(self.ssl_password_cb)
 
             ctx.set_cipher_list(self.ssl_cipher_list)
-            ctx.use_privatekey_file(self.ssl_private_key)
-            ctx.use_certificate_file(self.ssl_certificate)
+            try:
+              ctx.use_privatekey_file(self.ssl_private_key)
+              ctx.use_certificate_file(self.ssl_certificate)
+            except Exception, ex:
+              logging.exception('SSL key and certificate could not be found or have a problem')
+              raise ex
             ctx.set_options(SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3)
             self.socket = SSLConnection(ctx, self.socket)
             self.populate_ssl_environ()
-            
+ 
             # If listening on the IPV6 any address ('::' = IN6ADDR_ANY),
             # activate dual-stack. See http://www.cherrypy.org/ticket/871.
             if (not isinstance(self.bind_addr, basestring)