You can add the mitmproxy certificates to the Java trust store using keytool. On OSX, the required command looks like this:
sudo keytool -importcert -alias mitmproxy -storepass "password" \ -keystore /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts \ -trustcacerts -file ~/.mitmproxy/mitmproxy-ca-cert.pem
Note that your store password will (hopefully) be different from the one above.