Following the steps in Quickstart guide does not work when deploying opensearch using docker-compose

Hello,

I tried to follow the steps in quickstart guide Quickstart - OpenSearch documentation, but keep hitting the issue related to security.

curl https://localhost:9200 -ku admin:admin
{"error":{"status":"error","reason":"OpenSearch Security not initialized."}}

I don’t know what I am doing but, I tried to use the command given here: OpenSearch Security not initialized

./securityadmin.sh -cd ../securityconfig/ -icl -nhnv    -cacert ../../../config/root-ca.pem    -cert ../../../config/kirk.pem    -key ../../../config/kirk-key.pem
**************************************************************************
** This tool will be deprecated in the next major release of OpenSearch **
** https://github.com/opensearch-project/security/issues/1755           **
**************************************************************************
Security Admin v7
Will connect to localhost:9200 ... done
Connected as "CN=kirk,OU=client,O=client,L=test,C=de"
OpenSearch Version: 2.11.0
Contacting opensearch cluster 'opensearch' and wait for YELLOW clusterstate ...
Cannot retrieve cluster state due to: 30,000 milliseconds timeout on connection http-outgoing-2 [ACTIVE]. This is not an error, will keep on trying ...
  Root cause: java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-2 [ACTIVE] (java.net.SocketTimeoutException/java.net.SocketTimeoutException)
   * Try running securityadmin.sh with -icl (but no -cl) and -nhnv (If that works you need to check your clustername as well as hostnames in your TLS certificates)
   * Make sure that your keystore or PEM certificate is a client certificate (not a node certificate) and configured properly in opensearch.yml
   * If this is not working, try running securityadmin.sh with --diagnose and see diagnose trace log file)
   * Add --accept-red-cluster to allow securityadmin to operate on a red cluster.

But that didn’t help.

I am using docker(24.0.7) in ubuntu (22.04.3 LTS).

This worked: Docker - OpenSearch documentation