**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/test/java/org/elasticsearch/launcher/CliToolLauncherTests.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.launcher;
import org.elasticsearch.cli.MockTerminal;
import org.elasticsearch.test.ESTestCase;
import java.io.Closeable;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.elasticsearch.launcher.CliToolLauncher.createShutdownHook;
import static org.elasticsearch.launcher.CliToolLauncher.getToolName;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
public class CliToolLauncherTests extends ESTestCase {
    public void testCliNameSysprop() {