title: TLS handshake failed with error remote error: tls: bad certificate server=Orderer
body: <p>I am trying to set up a hyperledger fabric on a VM manually. I have generated all the artifacts and configured the <code>orderer.yaml</code> and <code>core.yaml</code>. I have orderer running on port <code>127.0.0.1:7050</code>. When I try to create channel using the peer cli <code>channel create</code> command I am getting a <code>context deadline exceeded</code> message on peer terminal.</p>
  
  <pre><code>./bin/peer channel create -o 127.0.0.1:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
  </code></pre>
  
  <blockquote>
    <p>Error: failed to create deliver client: orderer client failed to connect to 127.0.0.1:7050: failed to create new connection: context deadline exceeded</p>
  </blockquote>
  
  <p>On the orderer terminal I am getting the following error:</p>
  
  <blockquote>
    <p>2019-04-23 09:22:03.707 EDT [core.comm] ServerHandshake -> ERRO 01b TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=127.0.0.1:38618</p>
    
    <p>2019-04-23 09:22:04.699 EDT [core.comm] ServerHandshake -> ERRO 01c TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=127.0.0.1:38620</p>
    
    <p>2019-04-23 09:22:06.187 EDT [core.comm] ServerHandshake -> ERRO 01d TLS handshake failed with error remote error: tls: bad certificate server=Orderer remoteaddress=127.0.0.1:38622</p>
  </blockquote>
  
  <p>I have gone through the configurations a few time, I am not sure if I am missing something. Following is my <code>orderer.yaml</code></p>
  
  <pre><code>General:
    LedgerType: file
    ListenAddress: 127.0.0.1
    ListenPort: 7050
  
    TLS:
      Enabled: true
      PrivateKey: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
      Certificate: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
      RootCAs:
        - /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
      ClientAuthRequired: true
  
    Keepalive:
      ServerMinInterval: 60s
      ServerInterval: 7200s
      ServerTimeout: 20s
  
    GenesisMethod: file
  
    GenesisProfile: OneOrgOrdererGenesis
  
    GenesisFile: channel-artifacts/genesis.block
  
    LocalMSPDIR: /home/fabric-release/mynetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp
  
    LocalMSPID: OrdererMSP
  
    Authentication:
      TimeWindow: 15m
  
  FileLedger:
    Location: /var/hyperledger/production/orderer
    Prefix: hyperledger-fabric-ordererledger
  </code></pre>