title: Error: Invalid private key | Hyperledger Fabric Node SDK
body: <p>I am using the <strong>balance transfer sample</strong>.  </p>
  
  <p>I have enabled the <code>ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED=true</code> in orderer container.  </p>
  
  <p>While creating a new channel(mychannel) it was throwing error of <code>Handshake failed with fatal error</code>  </p>
  
  <p>After the error I configured the client   </p>
  
  <p><code>client.setTlsClientCertAndKey(cert, key);</code></p>
  
  <pre><code> let adminClient = JSON.parse(
        fs.readFileSync(path.join(__dirname, "../fabric-client-kv-org1/admin"))
      );
      logger.info(adminClient);
  
      client.setTlsClientCertAndKey(
        adminClient.enrollment.identity.certificate,
        adminClient.enrollment.signingIdentity
      );
  </code></pre>
  
  <p>I am importing <code>admin</code> and then using its signingIdentity and certificate to set the tls client.  </p>
  
  <p>Now, it is throwing error as <code>Invalid private key</code>   </p>
  
  <pre><code>E0619 17:15:44.135000000 139448 ssl_transport_security.cc:671] Invalid private key.
  E0619 17:15:44.136000000 139448 security_connector.cc:1087] Handshaker factory creation failed with TSI_INVALID_ARGUMENT.
  E0619 17:15:44.137000000 139448 secure_channel_create.cc:121] Failed to create secure subchannel for secure name 'localhost:7050'
  E0619 17:15:44.137000000 139448 secure_channel_create.cc:154] Failed to create subchannel arguments during subchannel creation.
  2019-06-19T11:45:47.132Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:7050
  2019-06-19T11:45:47.133Z - error: [Orderer.js]: Orderer grpcs://localhost:7050 has an error Error: Failed to connect before the deadline URL:grpcs://localhost:7050
  </code></pre>
  
  <p>What is the cause of error and Am I using the correct client certificate and key? It is confusing in docs   </p>
  
  <p><a href="https://fabric-sdk-node.github.io/tutorial-network-config.html" rel="nofollow noreferrer">https://fabric-sdk-node.github.io/tutorial-network-config.html</a>  </p>