X509: certificate is valid only for 127.0.0.1, not X.X.X.X

This is not deployed in K8s, its Single Host - VM - Linux Ubuntu!

After an installation of the Open Distro and Kibana - everything was OK but when I’m trying to setup the metricbeat for Elasticsearch as example it shows me the msg:
Exiting: couldn’t connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at https://X.X.X.X:9200: Get “https://X.X.X.X:9200”: x509: certificate is valid for 127.0.0.1, not X.X.X.X]
Any idea where and how to change my certificate to be valid for the IP X.X.X.X not localhost !?

Thank you,

Do you get any response on curl?

curl --insecure -u admin:admin https://<ip_address>:9200

Please post your elasticsearch.yml config.

Yes - curl working just fine and no problem with elasticsearch and kibana only problem is that I cannot setup metricbeat !?

elasticsearch.yml config file is everything OK

Network is 0.0.0.0
and All other relevant config details are ok couz its running and also Kibana is running … the only thing is that I cannot set up metricbeat due to that x509 certificate.
Well, I have commented all security things in the config file and also remove Kibana security so there is no more https needed to open them only http but again there is a problem loading the dashboards when i run: sudo metricbeat setup

Well this is part of the info how to deal with Beats in Open Distro;
https://opendistro.github.io/for-elasticsearch-docs/docs/troubleshoot/v

So anyone can tell me where or how to generate the ssl client .pem keys and certificates etc … like it is shown in the picture or you can check the link for more details.