This guide covers common issues and their solutions when using the MITM Proxy.
Symptoms: Browser displays "Your connection is not private" or similar warnings.
Solutions:
- Verify that you've installed the CA certificate correctly in your system or browser's trust store.
- Check that you're using the correct CA certificate and key files with the proxy.
- Restart your browser after installing the certificate.
Symptoms: Error messages about certificate creation in the proxy logs.
Solutions:
- Ensure the CA key file has the correct permissions.
- Verify that the CA certificate is valid and properly formatted.
- Check that the OpenSSL version is compatible.
Symptoms: Connection timeouts or refused connections.
Solutions:
- Verify the proxy is running with
ps aux | grep mitm-proxy. - Check that you're using the correct proxy address and port.
- Ensure no firewall is blocking the connection.
- Verify the proxy is listening on the correct interface (use
0.0.0.0to listen on all interfaces).
Symptoms: Proxy starts successfully but doesn't intercept any traffic.
Solutions:
- Verify your client is configured to use the proxy.
- Check that the proxy address is correctly specified in your client settings.
- Try a simple test with curl:
curl -x http://127.0.0.1:9999 http://example.com.
Symptoms: Traffic passes through the proxy but rules aren't being applied.
Solutions:
- Check that the rule file is in the correct directory.
- Verify the rule file has the correct extension (
.yamlor.yml). - Ensure both the rule file and the specific rule are enabled.
- Check the rule condition to make sure it matches your traffic.
- Run with
-debugflag to see detailed rule evaluation logs.
Symptoms: Errors about rule compilation when starting the proxy.
Solutions:
- Check the CEL expression syntax in your rule.
- Verify that any Go code in the script section is valid.
- Ensure all required imports are specified.
- Check for typos in property names.
Symptoms: Noticeably slower browsing or API responses when using the proxy.
Solutions:
- Minimize the number of rules to only those necessary.
- Optimize rule conditions to avoid expensive operations.
- Avoid reading and writing large request/response bodies when not necessary.
- Consider running the proxy on a more powerful machine.
Symptoms: Rules using environment variables don't work as expected.
Solutions:
- Verify the environment file exists and is correctly formatted.
- Check that the environment variable is defined in the file.
- Use the
-envflag to explicitly specify the environment file. - Check the template syntax in your rule:
{{ .Envs.VARIABLE_NAME }}.
For advanced troubleshooting, use the -debug flag to enable detailed logging:
./mitm-proxy -cacertfile ca.crt -cakeyfile ca.key -debugThis will show:
- Rule evaluation results
- Request and response details
- Certificate generation information
- Connection handling
You can also use the -test flag to test your rules without starting the proxy:
./mitm-proxy -cacertfile ca.crt -cakeyfile ca.key -rulesdir ./my_rules -test