# Metricbeat Error while enrolling: fail to execute the HTTP POST request: Post https://kibana

**URL:** <https://discuss.elastic.co/t/metricbeat-error-while-enrolling-fail-to-execute-the-http-post-request-post-https-kibana/162979>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 4, 2019, 3:18pm UTC](https://discuss.elastic.co/t/metricbeat-error-while-enrolling-fail-to-execute-the-http-post-request-post-https-kibana/162979 "2019-01-04T15:18:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Ryan\_Downey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_downey/32/35987_2.png) [@Ryan\_Downey](https://discuss.elastic.co/u/Ryan_Downey)\
**Post date:** [January 23, 2019, 2:27pm UTC](https://discuss.elastic.co/t/metricbeat-error-while-enrolling-fail-to-execute-the-http-post-request-post-https-kibana/162979/3 "2019-01-23T14:27:03Z")

</div>

Pier,

Sorry for my delay but I appreciate your response awhile back. I just got back around to troubleshooting this as some other projects took precedence over this one for the time being. I was able to work around this issue by pointing the autogenerated token link to a specific server within our Kibana cluster and remvoing the [kiban.gov](http://kiban.gov) part. Our setup like many has a VIP that directs data to one of the three Kibana servers in the pool. So we have [kibana-test.gov](http://kibana-test.gov) with [abc.gov](http://abc.gov), [def.gov](http://def.gov) and [ghi.gov](http://ghi.gov) servers and once I took out the [kibana-test.gov](http://kibana-test.gov) from the link and put in [abc.gov](http://abc.gov) with the username and password it worked. For this example, metricbeat on Windows Server 2016 pointing to RPM Linux Kibana, the below command worked.

```auto
 .\metricbeat.exe enroll -username elastic --password stdin --force http://abc.gov 14axxxxxxxxxxxxxxxxxxxxxxxxx

```

```auto
Saving a copy of current settings to metricbeat.yml.bak
Enrolled and ready to retrieve settings from Kibana

```

One of the other issues that popped up was that due to the fact that our Kibana servers sit behind the VIP I had to remove the https part and change it to http. The error message that I got with https was:

```auto
Error while enrolling: fail to execute the HTTP POST request: Post https://abc.gov:5601/api/beats/agent
/60ce4282-8666-480c-b088-c2208799c0ef: http: server gave HTTP response to HTTPS client

```

Overall removal of the link that Kibana generated and inputting a specific server within our DNS pool worked. Thanks for the help and hopefully this helps some others out as well. Enjoy the rest of your day.

---

_[View the full topic](https://discuss.elastic.co/t/metricbeat-error-while-enrolling-fail-to-execute-the-http-post-request-post-https-kibana/162979)._
