I have a process that is running on a specific port on my remote Ubuntu machine and I'm exposing that port via HTTP. When I tried to connect with my client using curl, I'm not able to connect, but if I do the same call on the remote machine locally, I can see that it connects. So I'm pretty sure that it is a network issue, but just not sure what it is?
Even trying on the remote host, I get the same error if I give the actual IP address of the machine!
Joes-MacBook-Pro:~ joe$ curl --verbose --insecure --cert .docker/cert.pem --key .docker/key.pem https://my.ip.address:1234/images/json
* About to connect() to my.ip.address port 1234 (#0)
* Trying my.ip.address... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
Joes-MacBook-Pro:~ joe$
A "Connection Refused" error will occur if your client sends a connection request to a remote server host, and the remote host responds to say that it refuses to accept the request. The "Connection Refused" error essentially means that the computer is not accepting connections to the requested IP address and port.
This occurs when the firewall in between is rejecting the connections. For example, when a firewall is restricting connections, customers see the following error. This indicates that the firewall is preventing connections to the remote host's specified port.
Please check your curl version first if it's greater than 7.33.0-3
Downgrade curl to 7.33.0-3. There is a known bug that is now fixed and should be released with the next version. I got bit by this too.
Reference Link : https://bbs.archlinux.org/viewtopic.php?id=175433 http://sourceforge.net/p/curl/bugs/1319/
I think i meet the same problem. At last I tried another port, and it worked. So maybe you can change the port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With