Errno 61 Connection refused


#1

I am trying to run mitmdump in my machine(osx 10.11.5).But whenever i send https requests to the server i get error 61 connection refused.it happens only with https requests http works fine .I am using mitmproxy version 2.0.0 and python 3.5.2 . Please go through the screenshot.


#2

This looks like a bug in your update.py script. For any more useful insights you’d need to post that. :wink:


#3

Thank you for looking into the problem.

def proxy_address(flow):
    return ('proxyip', port)

def request(flow):
    try:
        address = proxy_address(flow)
        if flow.live:
            flow.live.change_upstream_proxy_server(address)
    except Exception:
        print(Exception)

The code is same as change_upstream_proxy.py in the examples.The proxy_address function just returns a proxyaddress


#4

Ah yes. That’s a bug currently, but is already fixed on master and will be out with the next release. Sorry for the trouble.


#5

sir i tried pulling the master and tried running the script using mitmdump -m upstream:https://127.0.0.1:8085 -s updateitmproxy.py i still get the error Server connection to ('127.0.0.1', 8085) failed: Error connecting to "127.0.0.1": [Errno 61] Connection refused.


#6

sir i tried pulling the master and tried running the script using mitmdump -m upstream:https://127.0.0.1:8085 -s updateitmproxy.py i still get the errorServer connection to ('127.0.0.1', 8085) failed: Error connecting to "127.0.0.1": [Errno 61] Connection refused.


#7

This means there is no server listening on your local machine on port 8085.


#8

So mitmdump command is not working ??can u suggest what I should differently .This problem was not there when I was using mitmproxy version 0.18.2. I tried using all the other versions after 0.18.2 they all give me the same error.


#9

Again, the error message states that you have no server listening on 127.0.0.1:8085. When you invoke mitmproxy you instruct it to connect to said address, that doesn’t work and mitmproxy complains rightfully. There is no mitmproxy bug here.


#10

Thank you I will look into it.