2

Is there anything I could I execute from a linux command line from 2 different linux clients, in 2 different locations, that may show the presence of absence of an ERR_CONNECTION_RESET message (or similar) in the output of the connection attempt? I'd like to know if there's a way I can do this when attempting the connection via either the domain or full URI using https.

(My understanding is that an ERR_CONNECTION_RESET can be an indicator that a connection is failing due to a blocking firewall. I'm trying to establish whether there's a potential blocking firewall for a resource, when using one connection path compared to another).

0

1 Answer 1

1

The curl command will have an exit code of 56 when a connection reset by peer happens:

56 Failure in receiving network data.

curl http://someurl/
$ curl http://192.0.2.2:8080/
unfinished data...
curl: (56) Recv failure: Connection reset by peer
$ echo $?
56

There's no guarantee (from the documentation) that 56 is only caused by Connection reset by peer or even that Connection reset by peer can only exit with 56, but one can also filter the error on stderr like this (2>&1 is placed first on purpose):

LANG=C curl --no-progress-meter http://someurl/ 2>&1 >/dev/null |
    grep -Fq 'Connection reset by peer' && echo RST || echo non-RST

which would print RST for a Connection reset by peer and non-RST for anything else (including success).

It would be a brittle thing to use for production (this string could appear as header data etc.), but as it's for debugging a specific problem...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .