| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. -e |
| 2 | |
| 3 | mitmdump=${mitmdump:-mitmdump} |
| 4 | |
| 5 | if [[ -f ~/.mitmproxy/nvdump ]]; then |
| 6 | $mitmdump -S ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' --server-replay-reuse --server-replay-extra=forward -w newdump >mitmdump_output & |
| 7 | else |
| 8 | $mitmdump -w ~/.mitmproxy/nvdump -p 7890 --ignore-hosts '127\.0\.0\.1' >mitmdump_output & |
| 9 | fi |
| 10 | |
| 11 | mitm_pid=$! |
| 12 | |
| 13 | on_exitscip-shell shell shell-project 0.0.0 on_exit(). () { |
| 14 | killscip-shell system . . kill. -INT $mitm_pid |
| 15 | |
| 16 | if [[ -s newdump ]]; then |
| 17 | catscip-shell system . . cat. newdump >> ~/.mitmproxy/nvdump |
| 18 | fi |
| 19 | } |
| 20 | |
| 21 | trap on_exit EXIT |
| 22 | |
| 23 | if [[ -f keyfile.toml ]]; then |
| 24 | export KEYFILE=keyfile.toml |
| 25 | fi |
| 26 | |
| 27 | for _ in {1..10}; do |
| 28 | if [[ -s ~/.mitmproxy/mitmproxy-ca-cert.pem ]]; then |
| 29 | break |
| 30 | fi |
| 31 | sleepscip-shell system . . sleep. 1 |
| 32 | done |
| 33 | |
| 34 | export SSL_CERT_FILE=$HOME/.mitmproxy/mitmproxy-ca-cert.pem |
| 35 | export GIT_SSL_CAINFO=$SSL_CERT_FILE |
| 36 | export http_proxy=http://localhost:7890 https_proxy=http://localhost:7890 |
| 37 | |
| 38 | pytest |