We generate certificates that are intended to be used for server authentication in a couple of places:

- `bin/elasticsearch-certutil http` command  ( See `CertGenUtils.generateSignedCertificate` in `HttpCertificateCommand` )
- TLS auto-configuraion for node startup ( see [`AutoConfigureNode`](https://github.com/elastic/elasticsearch/blob/814f7f9f52cb8c05db6465b9bfc818ea5d76c575/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/AutoConfigureNode.java#L454) )

In these cases we know that the certificate is meant to be used for server authentication, so we can set Extended Key Usage extension to `1.3.6.1.5.5.7.3.1`
x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
final KeyStore pkcs12 = KeyStore.getInstance("PKCS12");
            pkcs12.load(null);
            pkcs12.setKeyEntry("ca", ca.certAndKey.key, ca.password, new Certificate[] { ca.certAndKey.cert });
            try (ZipEntryStream entry = new ZipEntryStream(zip, dirName + "/ca.p12")) {
                pkcs12.store(entry, ca.password);
            }
        } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException e) {
            throw new ElasticsearchException("Failed to write CA to ZIP file", e);
        }
    }
    private void writeKibanaInfo(ZipOutputStream zip, String dirName, CertificateTool.CAInfo ca, Environment env) {
        final String caCertName = "elasticsearch-ca.pem";
        final String caCert = ca == null ? "" : caCertName;
        final String ymlFile = "sample-kibana.yml";
        final Map<String, String> substitutions = buildSubstitutions(
            env,
            Map.ofEntries(Map.entry("CA_CERT_NAME", caCertName), Map.entry("CA_CERT", caCert), Map.entry("YML", ymlFile))
        );
        
        try {
            writeTextFile(zip, dirName + "/README.txt", KIBANA_README, substitutions);
            if (ca != null) {
                writePemEntry(zip, dirName + "/" + caCert, new JcaMiscPEMGenerator(ca.certAndKey.cert));
            }
            writeTextFile(zip, dirName + "/" + ymlFile, KIBANA_YML, substitutions);
        } catch (IOException e) {
            throw new ElasticsearchException("Failed to write Kibana details ZIP file", e);
        }
    }
    /**