# Hostname/IP does not match certificate's altnames

**URL:** <https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [July 12, 2023, 2:29pm UTC](https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234 "2023-07-12T14:29:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [July 12, 2023, 2:29pm UTC](https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234/1 "2023-07-12T14:29:40Z")

</div>

Hi there,  
I am trying to enroll kibana with elasticsearch cluster.  
Here is my deployment detail.

1. I have deployed an Elasticsearch cluster on an EC2 instance using docker and, I am able to access it using the publicIP of the EC2.

2. I am trying to run kibana in other EC2 instance in docker.  
So, when I am trying to connect to the Kibana, i am getting the following error:-

```auto
[2023-07-12T14:20:18.828+00:00][ERROR][plugins.interactiveSetup.elasticsearch] Failed to authenticate with host "https://ec2-44-200-137-40.compute-1.amazonaws.com:9200": Hostname/IP does not match certificate's altnames: Host: ec2-44-200-137-40.compute-1.amazonaws.com. is not in the cert's altnames: DNS:localhost, DNS:e3f66e0e6bf3, IP Address:FE80:0:0:0:F4B4:99FF:FE99:1B93, IP Address:172.17.0.2, IP Address:0:0:0:0:0:0:0:1, IP Address:127.0.0.1, IP Address:10.0.0.2, IP Address:FE80:0:0:0:70C4:12FF:FE38:73EA

```

Here is my kibana command: `docker run -it -e ELASTICSEARCH_URL=https://ec2-44-200-137-40.compute-1.amazonaws.com:9200 -p 5601:5601 kibana:8.7.0`

Can anyone please help me here. Which address should I provide in kibana?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [July 12, 2023, 10:06pm UTC](https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234/2 "2023-07-12T22:06:07Z")

</div>

In your kibana command, perhaps you can use the public IP, which you said you can use to access the cluster.

Another thought is, you could add an entry to your local `/etc/hosts` file that maps `e3f66e0e6bf3` to the IP. Then you could use `e3f66e0e6bf3` as the IP since that seems to be a valid altname.

I'm not an expert here, so it might be normal for the IP to change and my advice wouldn't work. This might be a question for the AWS support staff, honestly.

---

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [July 13, 2023, 3:11am UTC](https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234/3 "2023-07-13T03:11:36Z")

</div>

I got the solution here, I just need to add ` --net=host` in my command to map all the networking happening inside the docker container to the host.  
Now it's working fine.  
Thanks for taking out time to reply.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2023, 3:11am UTC](https://discuss.elastic.co/t/hostname-ip-does-not-match-certificates-altnames/338234/4 "2023-08-10T03:11:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
