| Index: client/tests/on_error_test.py
|
| diff --git a/client/tests/on_error_test.py b/client/tests/on_error_test.py
|
| index 3827a2c45b74f88b41fa410d28f12762ee702839..e7e9210c48cdf8902dbfd3b6f4b098404f549005 100755
|
| --- a/client/tests/on_error_test.py
|
| +++ b/client/tests/on_error_test.py
|
| @@ -131,8 +131,13 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|
|
| def start_server():
|
| """Starts an HTTPS web server and returns the port bound."""
|
| - # A premade passwordless self-signed certificate. It works because urllib
|
| - # doesn't verify the certificate validity.
|
| + # A premade passwordless self-signed certificate. It works because older
|
| + # urllib doesn't verify the certificate validity. Disable SSL certificate
|
| + # verification for more recent version.
|
| + create_unverified_https_context = getattr(
|
| + ssl, '_create_unverified_context', None)
|
| + if create_unverified_https_context:
|
| + ssl._create_default_https_context = create_unverified_https_context
|
| httpd = HttpsServer(('127.0.0.1', 0), Handler, 'localhost', pem=PEM)
|
| httpd.start()
|
| return httpd
|
|
|