-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaunch_chrome.sh
executable file
·26 lines (15 loc) · 1.08 KB
/
launch_chrome.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# generate certificate
#openssl req -x509 -newkey rsa:2048 -keyout $SCRIPTPATH/certs/localhost.key -out $SCRIPTPATH/certs/localhost.pem -days 365 -nodes -subj "/CN=127.0.0.1"
#openssl x509 -in $SCRIPTPATH/certs/localhost.pem -outform der -out $SCRIPTPATH/certs/localhost.der
#openssl rsa -in $SCRIPTPATH/certs/localhost.key -outform DER -out $SCRIPTPATH/certs/localhost_key.der
SPKI=`openssl x509 -inform der -in $SCRIPTPATH/certs/localhost.der -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64`
echo "Got cert key $SPKI"
echo "Opening google chrome"
case `uname` in
(*Linux*) google-chrome --origin-to-force-quic-on=127.0.0.1:4433 --ignore-certificate-errors-spki-list=$SPKI --enable-logging --v=1 ;;
(*Darwin*) open -a "Google Chrome" --args --origin-to-force-quic-on=127.0.0.1:4433 --ignore-certificate-errors-spki-list=$SPKI --enable-logging --v=1 ;;
esac
## Logs are stored to ~/Library/Application Support/Google/Chrome/chrome_debug.log