title: How to enable TLS in Elasticsearch non-interactively?
body: <p>According to <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.1/configuring-tls.html" rel="nofollow noreferrer">TLS configuration docs</a>, to generate certificates for TLS for Elasticsearch 7.1, you run:</p>
  
  <pre><code>elasticsearch-certutil ca
  elasticsearch-certutil cert --ca elastic-stack-ca.p12
  </code></pre>
  
  <p><sup>Related: <a href="https://stackoverflow.com/q/56744283/55075">Enabling TLS in Elasticsearch</a></sup></p>
  
  <p>The certificates are required to enable TLS via REST API.</p>
  
  <p>However, the above commands require human interaction (hitting <kbd>Enter</kbd>).</p>
  
  <p>How to generate above certificates non-interactively?</p>