I’m currently conducting penetration testing on a website, and I’m attempting to intercept requests using Mitmproxy to reverse engineer the backend APIs. However, I’m encountering a “502 Bad Gateway” error when trying to intercept the requests.
Here is the info:
Status 502 Bad Gateway
Version HTTP/2
Transferred 267 B (170 B size)
Referrer Policy strict-origin-when-cross-origin
Request Priority Highest
Request Headers:
content-type text/html
server mitmproxy 10.2.2
X-Firefox-Spdy h2
Response Headers:
Accept application/json, text/plain, */*
Accept-Encoding gzip, deflate, br
Accept-Language en-US,en;q=0.5
Connection keep-alive
Content-Length 227
Content-Type application/json
Host -----------
Origin https://-------
Referer https://-------/--/---
Sec-Fetch-Dest empty
Sec-Fetch-Mode cors
Sec-Fetch-Site same-origin
TE trailers
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Additional error message: “Certificate verify failed: self-signed certificate”
Error message: “502 Bad Gateway”
I’m using Mitmproxy version “10.2.2” on “Kali Linux”.
I’ve ensured that the server is running and accessible.
I’ve attempted to resolve the certificate verification issue by deleting the imported CA certificate and reimporting it into Firefox.
Additionally, I’ve addressed CORS issues that were previously encountered.
I’ve tried troubleshooting the issue by checking the server logs and verifying the configuration, but I haven’t been able to identify the root cause of the problem.
Any insights or suggestions on how to resolve this issue would be greatly appreciated. Thank you!