title: Hyperledger Fabric error: "TLS: bad certificate server" when installing chaincode
body: <p>I'm just starting learning HLF, and I have an error while following tutorial from the docs: <a href="https://hyperledger-fabric.readthedocs.io/en/release-2.2/deploy_chaincode.html" rel="nofollow noreferrer">link</a></p>
  <p>I downloaded fabric-samples using this command (replaced bit.ly link with the destination):</p>
  <pre><code>curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 2.2.2 1.4.9
  </code></pre>
  <p>I run logspout in one terminal and try to execute <code>peer lifecycle chaincode install basic.tar.gz</code> in another one, and this is the result i get</p>
  <blockquote>
  <p>Error: failed to retrieve endorser client for install: endorser client
  failed to connect to localhost:7051: failed to create new connection:
  context deadline exceeded</p>
  </blockquote>
  <p>Log presented by Logspout:</p>
  <blockquote>
  <p>peer0.org1.example.com|2022-03-15 13:03:24.452 UTC [core.comm]
  ServerHandshake -&gt; ERRO 04a Server TLS handshake failed in 2.650245ms
  with error remote error: tls: bad certificate server=PeerServer
  remoteaddress=172.22.0.1:61126</p>
  </blockquote>
  <p>I set the envs in terminal as instructed in the docs, and I checked that <code>CORE_PEER_TLS_ROOTCERT_FILE</code> variable points to an existing file. The content of the file is the same as on the container.</p>
  <p>What I tried to do:</p>
  <ul>
  <li>download fabric-samples again and redo all the setup with copy-pasting the commands directly from docs</li>
  </ul>
  <p>Do you have any suggestions where I can look for an issue?</p>