Skip to content

Instantly share code, notes, and snippets.

@alufers
Created July 8, 2023 14:19
Show Gist options
  • Save alufers/33f4324e56468f108a984fd5b6390b37 to your computer and use it in GitHub Desktop.
Save alufers/33f4324e56468f108a984fd5b6390b37 to your computer and use it in GitHub Desktop.
Run chrome with mitmproxy certificate
#!/bin/bash
MITMPROXY_SPKI=$(
cat ~/.mitmproxy/mitmproxy-ca-cert.pem |
openssl x509 -inform pem -noout -outform pem -pubkey |
openssl pkey -pubin -inform pem -outform der |
openssl dgst -sha256 -binary |
openssl enc -base64
)
CHROME_BINARY="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
"$CHROME_BINARY" --disable-background-networking \
--no-first-run \
--no-default-browser-check \
--disable-restore-session-state \
--proxy-server="http://localhost:9999" \
--noerrdialogs \
--disable-default-apps \
--disable-translate \
--proxy-bypass-list="<-loopback>" \
--ignore-certificate-errors-spki-list="$MITMPROXY_SPKI" \
https://my-bank.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment