New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 767532 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

ssl-key-log-file switch not respected in headless mode

Reported by shanemha...@gmail.com, Sep 21 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36

Steps to reproduce the problem:
1. chromium-browser  --ssl-key-log-file=/tmp/foo.log --headless --screenshot --window-size=1280,1696 --disable-gpu 'https://www.google.com/'
2. Look for /tmp/foo.log, observe it doesn't exist.

What is the expected behavior?
A file named /tmp/foo.log is created in the format specified here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format

Note: this works in non-headless mode.

What went wrong?
No file named /tmo/foo.log exists.

Did this work before? No 

Chrome version: 63.0.3221.0  Channel: stable
OS Version: 16.04
Flash Version: none

It appears that the ssl-key-log-file is used in src/chrome/browser/io_thread.cc in the IOThread::Init() method.

I'm not familiar enough with headless mode to understand why this code isn't used in headless mode. However src/headless/app/headless_shell.cc seems to be where headless mode does argument parsing. I have a patch that duplicates the GetSSLKeyLogFile() function from io_thread.cc and calls it from HeadlessShell::OnStart(). This seems to fix the issue.

I'm a first time contributor and would love if someone was willing to review the patch. I'll sign a CLA and submit a patch shortly.
 
Components: -Platform>DevTools Internals>Headless Internals>Network>SSL
Thanks! Feel free to add me as a reviewer.
Cc: divya.pa...@techmahindra.com
Labels: Proj-Headless Triaged-ET
Appropriate component is added for further triage
Any other suggestions for a reviewer? https://chromium-review.googlesource.com/c/chromium/src/+/677569
Cc: aga...@chromium.org
Oh, sorry, you need to get it out of WIP state otherwise it doesn't send email. (+agable, this is kind of confusing.)
I've stamped it, but you'll want to someone from headless/OWNERS to approve the change. Do so with the "Start review" button so that they get email.
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b98719931b9a0382dd950e737b113e17820733c

commit 6b98719931b9a0382dd950e737b113e17820733c
Author: Shane Hansen <shanemhansen@gmail.com>
Date: Thu Oct 05 18:09:35 2017

headless: support ssl-key-log-file flag

Headless users may want to decode captured traffic.

Bug:  767532 
Change-Id: Ied7fa3ec4fb771f845d9c38eb2a476f2e5a3b018
Reviewed-on: https://chromium-review.googlesource.com/677569
Commit-Queue: David Benjamin <davidben@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506787}
[modify] https://crrev.com/6b98719931b9a0382dd950e737b113e17820733c/AUTHORS
[modify] https://crrev.com/6b98719931b9a0382dd950e737b113e17820733c/headless/app/headless_shell.cc
[modify] https://crrev.com/6b98719931b9a0382dd950e737b113e17820733c/headless/app/headless_shell_switches.cc
[modify] https://crrev.com/6b98719931b9a0382dd950e737b113e17820733c/headless/app/headless_shell_switches.h

Status: Fixed (was: Unconfirmed)
Thanks Shane!

Sign in to add a comment