**Kibana version:**  8.3 Snapshot Kibana self-managed environment

**Host OS and Browser version:** Windows, All

**Build details:**
```
VERSION: 8.3.0 Snapshot self-managed
BUILD: 52512
COMMIT: df225b213b188c81888141cee2ec191424fc0649
Elasticsearch artifact link: https://snapshots.elastic.co/8.3.0-6ba9f710/downloads/elasticsearch/elasticsearch-8.3.0-SNAPSHOT-windows-x86_64.zip
```

**Preconditions:**
1. 8.3 Snapshot Kibana self-managed environment should be available.

**Steps to reproduce:**
1. Navigate to `C:\elk\elasticsearch\bin>` through cmd.
2. Run below command:
`elasticsearch-certutil ca --pem`
3. Observe Java exceptions on running cert creation command.

**Expected Result:**
 CA cert should be created on running `elasticsearch-certutil ca --pem` command.

**Screenshot:**
![1](https://user-images.githubusercontent.com/77374876/167078819-20c28e8e-5886-443f-8ab7-1e58d80fb1e2.JPG)


distribution/tools/cli-launcher/src/main/java/org/elasticsearch/launcher/CliToolLauncher.java
private static final String SCRIPT_PREFIX = "elasticsearch-";
    private static volatile Command command;
    /**
     * Runs a CLI tool.
     *
     * <p>
     * The following system properties may be provided:
     * <ul>
     *     <li><code>cli.name</code> - the name of the tool to run</li>
     *     <li><code>cli.script</code> - the path to the script that is being run</li>
     *     <li><code>cli.libs</code> - optional, comma separated list of additional lib directories
     *                                 that should be loaded to find the tool</li>
     * </ul>
     * One of either <code>cli.name</code> or <code>cli.script</code> must be provided.
     *
     * @param args args to the tool
     * @throws Exception if the tool fails with an unknown error
     */
    public static void main(String[] args) throws Exception {
        ProcessInfo pinfo = ProcessInfo.fromSystem();
        
        configureLoggingWithoutConfig(pinfo.sysprops());
        String toolname = getToolName(pinfo.sysprops());
        String libs = pinfo.sysprops().getOrDefault("cli.libs", "");
        command = CliToolProvider.load(toolname, libs).create();