mitmweb --mode upstream:https://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q all…
- User
mitmweb --mode upstream:https://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q
all connections are 405 CONNECT. why? help.
- Assistant
mitmweb --mode upstream:https://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q
all connections are 405 CONNECT. why? help.
The 405 CONNECT error usually occurs when there's a problem with how the proxy or the server is handling the HTTP CONNECT requests needed to establish a tunnel for HTTPS traffic. In your setup, the mitmweb tool is being used as an upstream proxy to forward traffic to another proxy or endpoint (88.218.73.21:9500).
There are several potential reasons for encountering a 405 Method Not Allowed error:
Server-side Restrictions: The upstream server at 88.218.73.21:9500 may not support or allow HTTP CONNECT requests. Verify that the server at 88.218.73.21:9500 is configured to handle CONNECT requests.
Incorrect Mode Configuration: Ensure that the mode you've specified (upstream:https://88.218.73.21:9500) is correctly configured and appropriate for the upstream server. Double-check the server's protocol (HTTP vs. HTTPS) and port.
Upstream Authentication: Make sure that the credentials provided (zwzzq1:zdLo1Q) are correct and that the upstream proxy supports basic authentication.
Mitmproxy Configuration: Ensure that mitmproxy (which mitmweb uses under the hood) is correctly set up. Sometimes mitmweb has bugs or misconfigurations that might lead to unexpected behavior.
Here is what you can try:
curl) to verify it handles CONNECT requests:curl -x https://zwzzq1:zdLo1Q@88.218.73.21:9500 https://www.example.com -v
curl fails, it indicates that the problem lies with the upstream server or its configuration.mitmweb with additional logging enabled to get more details:mitmweb --mode upstream:https://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q --set console_eventlog_verbosity=debug
mitmweb --mode upstream:http://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q
upstream:https with upstream:http if the upstream proxy expects HTTP instead of HTTPS.Ensure the protocol specified (http vs. https) matches what the upstream server expects. Mismatched protocols can cause failures.
Check the documentation or support resources for the proxy server running at 88.218.73.21:9500. The specific version or configuration might have special requirements or known issues with mitmproxy.
If the problem persists, consider testing with the mitmproxy command (without the web interface) to see if the issue also occurs there:
mitmproxy --mode upstream:https://88.218.73.21:9500 --upstream-auth zwzzq1:zdLo1Q
As a last resort, you can try using a different proxy tool to route your traffic to see if it handles the upstream proxy better (e.g., squid or tinyproxy).
By following these steps, you should be able to diagnose and potentially resolve the 405 CONNECT error.
Not yet included in a published release.