Bug 1321517 - Improve error when unable to find SSL key or cert. r=ato
authorVenkatesh Pitta <venkateshpitta@gmail.com>
Tue, 27 Mar 2018 04:52:34 +1100
changeset 411681 c7abc1d5b6ec9d32f54745f51e96065a89b774bf
parent 411680 a5111bd8a4f6f24fc38c859a07dc0d09c6cb3a5b
child 411682 1f158432b80165534e86a82cc1d9b74f6b543bb8
push id101729
push usercsabou@mozilla.com
push dateWed, 04 Apr 2018 18:07:35 +0000
treeherdermozilla-inbound@3c240f56a113 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1321517
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1321517 - Improve error when unable to find SSL key or cert. r=ato
testing/web-platform/tests/tools/wptserve/wptserve/server.py
--- a/testing/web-platform/tests/tools/wptserve/wptserve/server.py
+++ b/testing/web-platform/tests/tools/wptserve/wptserve/server.py
@@ -394,19 +394,20 @@ class WebTestHttpd(object):
 
         self.use_ssl = use_ssl
         self.logger = get_logger()
 
         if server_cls is None:
             server_cls = WebTestServer
 
         if use_ssl:
-            if key_file is not None:
-                assert os.path.exists(key_file)
-            assert certificate is not None and os.path.exists(certificate)
+            if not os.path.exists(key_file):
+                raise ValueError("SSL certificate not found: {}".format(key_file))
+            if not os.path.exists(certificate):
+                raise ValueError("SSL key not found: {}".format(certificate))
 
         try:
             self.httpd = server_cls((host, port),
                                     handler_cls,
                                     self.router,
                                     self.rewriter,
                                     config=config,
                                     bind_hostname=bind_hostname,