title: elasticdump with TLS - unable to verify the first certificate
body: <p>Using elasticsearch 7.9.3 with TLS security. I can connect to it via python, curl and openssl using the ca certificates I generated.</p>
  <pre><code># These work, but this is a fake domain name
  openssl s_client -connect node0:9200 -CAfile /etc/elasticsearch/certs/ca.pem
  curl --cacert /etc/elasticsearch/certs/ca.crt -u &quot;elastic:$ELASTIC_PASS&quot; 'https://node0.elastic.test.com:9200/_cat/health'
  
  # Node / elasticdump is not happy
  $ elasticdump --input=./account_mapping.json --output=&quot;https://elastic:$ELASTIC_PASS@node0.elastic.test.com:9200/account&quot; --type=mapping
  Thu, 19 Nov 2020 21:28:50 GMT | starting dump
  Thu, 19 Nov 2020 21:28:50 GMT | got 1 objects from source file (offset: 0)
  Thu, 19 Nov 2020 21:28:50 GMT | Error Emitted =&gt; unable to verify the first certificate
  Thu, 19 Nov 2020 21:28:50 GMT | Error Emitted =&gt; unable to verify the first certificate
  Thu, 19 Nov 2020 21:28:50 GMT | Total Writes: 0
  Thu, 19 Nov 2020 21:28:50 GMT | dump ended with error (get phase) =&gt; Error: unable to verify the first certificate
  
  $ npm config set cafile /etc/elasticsearch/certs/ca.pem
  # same result
  Thu, 19 Nov 2020 21:28:50 GMT | dump ended with error (get phase) =&gt; Error: unable to verify the first certificate
  
  $ elasticdump --input=../account_mapping.json --output=&quot;https://elastic:$ELASTIC_PASS@node1.elastic.test.com:9200/account&quot; --type=mapping --output-ca=/etc/elasticsearch/certs/ca.pem
  # same result
  </code></pre>
  <p>Other posts suggested running with NODE_TLS_REJECT_UNAUTHORIZED=0, but that did not fix the problem in this case.</p>