Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: client/tests/on_error_test.py

Issue 2857443002: Finally fix on_error_test hang. (Closed)
Patch Set: Add default None value for getattr() Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698