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
dn = tryReadInput(terminal, "CA Name", dn, name -> {
                try {
                    if (name.contains("=")) {
                        return new X500Principal(name);
                    } else {
                        return new X500Principal("CN=" + name);
                    }
                } catch (IllegalArgumentException e) {
                    terminal.println(Terminal.Verbosity.SILENT, "'" + name + "' is not a valid CA name (" + e.getMessage() + ")");
                    return null;
                }
            });
            printHeader("How long should your CA be valid?", terminal);
            terminal.println("Every certificate has an expiry date. When the expiry date is reached, clients");
            terminal.println("will stop trusting your Certificate Authority and TLS connections will fail.");
            terminal.println("");
            terminal.println("We recommend that you set this to a long duration (3 - 5 years) and then perform a");
            terminal.println("manual update a few months before it expires.");
            terminal.println("You may enter the validity period in years (e.g. 3Y), months (e.g. 18M), or days (e.g. 90D)");
            validity = readPeriodInput(terminal, "CA Validity", validity, 90);
            printHeader("What key size should your CA have?", terminal);
            terminal.println("The RSA private key for your Certificate Authority has a fixed 'key size' (in bits).");
            terminal.println("Larger key sizes are generally more secure, but are also slower.");
            terminal.println("");
            terminal.println("We recommend that you use one of 2048, 3072 or 4096 bits for your key.");
            keySize = readKeySize(terminal, keySize);
            terminal.println("");
        }
        try {
            final KeyPair keyPair = CertGenUtils.generateKeyPair(keySize);