title: Getting error curl: (56) Recv failure: Connection reset by peer
body: <p>I know this error has been posted before on StackOverflow and many solutions/answers are available too. But, I've already gone through all those answers and couldn't find any viable solution for me.</p>
  
  <p>I'm running a Hyperledger Fabric network with single peer and orderer. Their Docker containers have exposed the following ports. <code>7051:7051</code> &amp; <code>7053:7053</code> on peer, <code>7050:7050</code> on orderer. I'm trying to configure Prometheus to analyse the metrics by following the official <a href="https://hyperledger-fabric.readthedocs.io/en/latest/operations_service.html#" rel="nofollow noreferrer">documentation</a> . </p>
  
  <p>As mentioned in the documentation, I'm exposing my local machine's <code>9443</code> port to port <code>9443</code> of peer docker container by mapping it as <code>9443:9443</code> in <code>ports</code> section of <code>docker-compose.yaml</code>. When I run <code>curl 0.0.0.0:9443</code>, I get <code>curl: (56) Recv failure: Connection reset by peer</code> error.</p>
  
  <p>However, when I run the command <code>curl 0.0.0.0:9443/logspec</code> in my peer container I get the desired result which is <code>{"spec":"info"}</code>. The two commands mentioned above are different but I've also tried running the command <code>curl 0.0.0.0:9443/logspec</code> in my local machine to which I got the same error response.</p>
  
  <p>Running the command <code>curl -v 0.0.0.0:9443</code> results in following response.</p>
  
  <pre><code>* About to connect() to 0.0.0.0 port 9443 (#0)
  *   Trying 0.0.0.0...
  * Connected to 0.0.0.0 (0.0.0.0) port 9443 (#0)
  &gt; GET / HTTP/1.1
  &gt; User-Agent: curl/7.29.0
  &gt; Host: 0.0.0.0:9443
  &gt; Accept: */*
  &gt;
  * Recv failure: Connection reset by peer
  * Closing connection 0
  curl: (56) Recv failure: Connection reset by peer
  </code></pre>
  
  <p>I read in many of the answers that I might be a firewall issue. But even after disabling my firewall using the command <code>systemctl disable firewalld</code>, it's not working.</p>
  
  <p><code>cat etc/os-release</code> response</p>
  
  <pre><code>NAME="CentOS Linux"
  VERSION="7 (Core)"
  ID="centos"
  ID_LIKE="rhel fedora"
  VERSION_ID="7"
  PRETTY_NAME="CentOS Linux 7 (Core)"
  CPE_NAME="cpe:/o:centos:centos:7"
  HOME_URL="https://www.centos.org/"
  BUG_REPORT_URL="https://bugs.centos.org/"
  
  CENTOS_MANTISBT_PROJECT="CentOS-7"
  CENTOS_MANTISBT_PROJECT_VERSION="7"
  REDHAT_SUPPORT_PRODUCT="centos"
  REDHAT_SUPPORT_PRODUCT_VERSION="7"
  </code></pre>
  
  <p><code>curl --version</code> response</p>
  
  <pre><code>curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.34 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
  </code></pre>
  
  <p>I request you not to mark this question as duplicate as I've already gone through all the possible scenarios mentioned <a href="https://stackoverflow.com/a/10349895/6352772">here</a>.</p>