# Installing mitmproxy CA certificate

**URL:** <https://travis-ci.community/t/installing-mitmproxy-ca-certificate/11257>\
**Category:** Linux\
**Created:** [March 6, 2021, 9:06am UTC](https://travis-ci.community/t/installing-mitmproxy-ca-certificate/11257 "2021-03-06T09:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itaibh](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/itaibh/32/3231_2.png) [@itaibh](https://travis-ci.community/u/itaibh)\
**Post date:** [March 6, 2021, 9:06am UTC](https://travis-ci.community/t/installing-mitmproxy-ca-certificate/11257/1 "2021-03-06T09:06:23Z")

</div>

Hello.  
I have a rare condition that only reproduces on CI sometimes. It’s network related, so I thought I’d install a proxy. Problem is I can’t install the proxy certificate and thus the build fails (or in my case get stuck in an endless loop of retries, but that’s solvable)

This is the script I run to install and run the proxy (I chose `mitmproxy` and want to use `mitmdump`):

```auto
#!/usr/bin/env bash
sudo apt-get install mitmproxy
sudo mkdir /usr/share/ca-certificates/extra
sudo cp ~/.mitmproxy/mitmproxy-ca-cert.cer /usr/share/ca-certificates/extra
sudo echo "extra/mitmproxy-ca-cert.cer" >> /etc/ca-certificates.conf
sudo update-ca-certificates
mitmdump -s ./har_dump.py --set hardump=./network.log.har &

```

and these are the lines I see when it runs:

```auto
cp: cannot stat '/home/travis/.mitmproxy/mitmproxy-ca-cert.cer': No such file or directory
./setup_proxy.sh: line 5: /etc/ca-certificates.conf: Permission denied

```

Is installing new certificates even possible on Travis-CI? Is there a built-in proxy or certificate I can use? Also, where is `mitmproxy` installed if not at `/home/travis/.mitmproxy`? Where are things get installed?

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [March 6, 2021, 10:12am UTC](https://travis-ci.community/t/installing-mitmproxy-ca-certificate/11257/2 "2021-03-06T10:12:44Z")

</div>

> [@Any way to control core file location?](https://travis-ci.community/t/any-way-to-control-core-file-location/3656/4):
>
> Redirection happens in the non-elevated bash here. The linked question uses tricks like tee, sysctl and bash -c for a reason.

> <https://stackoverflow.com/questions/36987028/cant-find-mitmproxy-ca-cert-pem>

---

<div class="post-metadata">

**Author:** ![itaibh](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/itaibh/32/3231_2.png) [@itaibh](https://travis-ci.community/u/itaibh)\
**Post date:** [March 6, 2021, 1:06pm UTC](https://travis-ci.community/t/installing-mitmproxy-ca-certificate/11257/3 "2021-03-06T13:06:49Z")

</div>

It took some digging in but this was indeed the solution.

Thanks!
