# ERR Connecting error publishing events (retrying): Get https://localhost:9200: http: server gave HTTP response to HTTPS client

**URL:** https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973
**Category:** Beats
**Tags:** winlogbeat
**Created:** [December 26, 2016, 4:38am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973 "2016-12-26T04:38:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![prakash1243](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@prakash1243](https://discuss.elastic.co/u/prakash1243)
#### Post date: [December 26, 2016, 4:38am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/1 "2016-12-26T04:38:17Z")

</div>

I had installed Elastic Search , Kibana running with 5.1.1 version, And I tried to run the Win log beats, where I couldn't get any data, instead throws the error in the logs.

**ERR Connecting error publishing events (retrying): Get [https://localhost:9200](https://localhost:9200): http: server gave HTTP response to HTTPS client**

Winlogbeat YML:

winlogbeat.event\_logs:

- name: Application  
ignore\_older: 24h
- name: Security  
ignore\_older: 24h
- name: System  
ignore\_older: 24h
- name: Microsoft-Windows-Windows Firewall With Advanced Security/Firewall  
ignore\_older: 24h

output.elasticsearch:  
hosts:  
- [https://localhost:9200](https://localhost:9200)  
template.enabled: true  
template.path: "winlogbeat.template.json"  
template.overwrite: false  
index: "winlogbeat"

logging.to\_files: true  
logging.files:  
path: 'C:\ProgramData\winlogbeat\Logs'  
logging.level: info

Please let me know, if anything is wrong.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 26, 2016, 4:42am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/2 "2016-12-26T04:42:42Z")

</div>

Out of the box Elasticsearch does not support HTTPS. If you have not explicitly secured it, I would recommend trying to connect using HTTP instead of HTTPS.

---

<div class="post-metadata">

### Author: ![prakash1243](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@prakash1243](https://discuss.elastic.co/u/prakash1243)
#### Post date: [December 26, 2016, 5:54am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/3 "2016-12-26T05:54:31Z")

</div>

Thanks for your reply, I've changed it to 'http' in he winbeat.yml (pasted below).

winlogbeat.event\_logs:

- name: Application  
ignore\_older: 24h
- name: Security  
ignore\_older: 24h
- name: System  
ignore\_older: 24h
- name: Microsoft-Windows-Windows Firewall With Advanced Security/Firewall  
ignore\_older: 24h

output.elasticsearch:  
hosts:  
- [http://localhost:9200](http://localhost:9200)  
template.enabled: true  
template.path: "winlogbeat.template.json"  
template.overwrite: false  
index: "winlogbeat"

logging.to\_files: true  
logging.files:  
path: 'C:\ProgramData\winlogbeat\Logs'  
logging.level: info

When I run the .\winlogbeat -e commmad, it started giving the 401-unauthorized error.

X-pack has been added, so it is secured with the credentials, but after providing the Elastic search credentials as well, I still hit the Un-Authorized issue. (2016/12/26 05:48:18.861011 single.go:140: ERR Connecting error publishing events (retrying): 401 Unauthorized)

Would you please let me know the right way to provide the Elastic search credentials on the .yml file. Thanks !

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 26, 2016, 6:02am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/4 "2016-12-26T06:02:32Z")

</div>

As you have secured it through X-Pack, have you read [this](https://www.elastic.co/guide/en/x-pack/current/beats.html)?

---

<div class="post-metadata">

### Author: ![prakash1243](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@prakash1243](https://discuss.elastic.co/u/prakash1243)
#### Post date: [December 26, 2016, 6:14am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/5 "2016-12-26T06:14:18Z")

</div>

Yep, I provided the Elastic Search Credential on the winlogbeats.yml and successfully able to create the logs and data, Below is the snippet:

PS C:\Program Files\Winlogbeat\> .\winlogbeat -e  
2016/12/26 06:09:22.928711 beat.go:267: INFO Home path: [C:\Program Files\Winlogbeat] Config path: [C:\Program Files\Win  
logbeat] Data path: [C:\Program Files\Winlogbeat\data] Logs path: [C:\Program Files\Winlogbeat\logs]  
2016/12/26 06:09:22.929711 beat.go:177: INFO Setup Beat: winlogbeat; Version: 5.1.1  
2016/12/26 06:09:22.930711 output.go:167: INFO Loading template enabled. Reading template file: C:\Program Files\Winlogb  
eat\winlogbeat.template.json  
2016/12/26 06:09:22.928711 logp.go:219: INFO Metrics logging every 30s  
2016/12/26 06:09:22.933711 output.go:178: INFO Loading template enabled for Elasticsearch 2.x. Reading template file: C:  
\Program Files\Winlogbeat\winlogbeat.template-es2x.json  
2016/12/26 06:09:22.935711 client.go:120: INFO Elasticsearch url: [http://localhost:9200](http://localhost:9200)  
2016/12/26 06:09:22.936711 outputs.go:106: INFO Activated elasticsearch as output plugin.  
2016/12/26 06:09:22.937711 publish.go:291: INFO Publisher name: AAEINBLR03199L  
2016/12/26 06:09:22.944711 async.go:63: INFO Flush Interval set to: 1s  
2016/12/26 06:09:22.944711 async.go:64: INFO Max Bulk Size set to: 50  
2016/12/26 06:09:22.945711 winlogbeat.go:71: INFO State will be read from and persisted to C:\Program Files\Winlogbeat\d  
ata.winlogbeat.yml  
2016/12/26 06:09:22.947711 beat.go:207: INFO winlogbeat start running.  
2016/12/26 06:09:22.997711 client.go:652: INFO Connected to Elasticsearch version 5.1.1  
2016/12/26 06:09:22.998711 output.go:214: INFO Trying to load template for client: [http://localhost:9200](http://localhost:9200)  
2016/12/26 06:09:22.999711 output.go:235: INFO Template already exists and will not be overwritten.  
2016/12/26 06:09:23.012711 winlogbeat.go:237: INFO EventLog[Application] Successfully published 2 events

And, Would you please help me in getting this on the Kiabana dashboard ? Thanks so much for your help.

PS: Am having the setup on Windows-7.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 26, 2016, 6:34am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/6 "2016-12-26T06:34:30Z")

</div>

If the initial issue has been resolved, I would recommend that you create a new issue in the appropriate category for getting advice on how to best visualize this in Kibana. I do not have any Windows machine available, so will unfortunately not be able to help.

---

<div class="post-metadata">

### Author: ![prakash1243](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@prakash1243](https://discuss.elastic.co/u/prakash1243)
#### Post date: [December 26, 2016, 6:38am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/7 "2016-12-26T06:38:29Z")

</div>

Sure, I'll log a new case. Thanks so much. 🙂

---

<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: [January 23, 2017, 6:39am UTC](https://discuss.elastic.co/t/err-connecting-error-publishing-events-retrying-get-https-localhost-9200-http-server-gave-http-response-to-https-client/69973/8 "2017-01-23T06:39:13Z")

</div>

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