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

Unified Diff: tools/telemetry/telemetry/core/platform/android_platform_backend.py

Issue 903153002: Install android test certificate authority when host supports SNI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO to move cert creation (certutils calls) to webpagereplay.py. Created 5 years, 10 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 | « DEPS ('k') | tools/telemetry/telemetry/unittest_util/system_stub.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/android_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
index 3d7132effc22eba510818411aa08329fb1a3001f..9fb0ec8c21028e4f463a72d54b71729b7c0dee5e 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
@@ -437,12 +437,19 @@ class AndroidPlatformBackend(
This allows transparent HTTPS testing with WPR server without need
to tweak application network stack.
"""
+ # TODO(slamm): Move certificate creation related to webpagereplay.py.
+ # The only code that needs to be in platform backend is installing the cert.
if certutils.openssl_import_error:
logging.warning(
'The OpenSSL module is unavailable. '
'Will fallback to ignoring certificate errors.')
return
-
+ if not certutils.has_sni():
+ logging.warning(
+ 'Web Page Replay requires SNI support (pyOpenSSL 0.13 or greater) '
+ 'to generate certificates from a test CA. '
+ 'Will fallback to ignoring certificate errors.')
+ return
try:
self._wpr_ca_cert_path = os.path.join(tempfile.mkdtemp(), 'testca.pem')
certutils.write_dummy_ca_cert(*certutils.generate_dummy_ca_cert(),
@@ -453,12 +460,13 @@ class AndroidPlatformBackend(
self._adb.device_serial())
self._device_cert_util.install_cert(overwrite_cert=True)
self._is_test_ca_installed = True
- except Exception:
+ except Exception as e:
# Fallback to ignoring certificate errors.
self.RemoveTestCa()
- logging.warning('Unable to install test certificate authority on device: '
- '%s. Will fallback to ignoring certificate errors.'
- % self._adb.device_serial())
+ logging.warning(
+ 'Unable to install test certificate authority on device: %s. '
+ 'Will fallback to ignoring certificate errors. Install error: %s',
+ self._adb.device_serial(), e)
@property
def is_test_ca_installed(self):
« no previous file with comments | « DEPS ('k') | tools/telemetry/telemetry/unittest_util/system_stub.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698