Skip to content

Commit

Permalink
try installing in NSS shared DB
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrence-forooghian committed Apr 22, 2024
1 parent 5da7d86 commit ef0dc36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test-browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ jobs:
- name: Install NSS tools
run: sudo apt install libnss3-tools

# This works for Chromium (see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md)
# Note this is the same command that we use for adding it to the Firefox profile (see playwrightHelpers.js)
# TODO does it work for WebKit?
- name: Install mitmproxy root CA in NSS shared DB
run: |
mkdir -p ~/.pki/nssdb
certutil -A -d sql:$HOME/.pki/nssdb -t C -n "Mitmproxy Root Cert" -i ~/.mitmproxy/mitmproxy-ca-cert.pem
- name: Run the tests
env:
PLAYWRIGHT_BROWSER: ${{ matrix.browser }}
Expand Down
8 changes: 4 additions & 4 deletions test/support/playwrightHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ async function openPlaywrightBrowser(headless) {
`certutil -A -d ${profileDirectory} -t C -n "Mitmproxy Root Cert" -i ~/.mitmproxy/mitmproxy-ca-cert.pem`,
);
break;
default:
// TODO chromium, webkit
// Bear in mind that on a developer’s machine we don’t really want to install any root CA certs that will have a global effect; keep it localised to the
throw new Error(`Don’t yet know how to install root CA cert for browser ${browserEnv}`);
//default:
//// TODO chromium, webkit
//// Bear in mind that on a developer’s machine we don’t really want to install any root CA certs that will have a global effect; keep it localised to the
//throw new Error(`Don’t yet know how to install root CA cert for browser ${browserEnv}`);
}

const options = {
Expand Down

0 comments on commit ef0dc36

Please sign in to comment.