# Elastic-agent add - error protocol integration http/https

**URL:** <https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401>\
**Category:** Elastic Agent\
**Tags:** elastic-stack-security\
**Created:** [November 8, 2022, 9:16am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401 "2022-11-08T09:16:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![grillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grillo/32/84079_2.png) [@grillo](https://discuss.elastic.co/u/grillo)\
**Post date:** [November 8, 2022, 9:16am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/1 "2022-11-08T09:16:59Z")

</div>

Hi,

I have created a security policy for a windows computer and now I want to associate the windows computers with the "elastic-agent"... I have installed it as a service and I have specified, as indicated...

```auto
revision: 3
outputs:
  default:
    type: elasticsearch
    hosts:
      - 'https://10.172.211.30:9200'
    username: '{ES_USERNAME}'
    password: '{ES_PASSWORD}'

```

It doesn't connect - elasticsearch logs shows

received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress.

how can I solve that? Y  
What authentication methods would you recommend for these cases?

Thank you very much

---

<div class="post-metadata">

**Author:** ![lesio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lesio/32/89323_2.png) [@lesio](https://discuss.elastic.co/u/lesio)\
**Post date:** [November 9, 2022, 8:47am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/2 "2022-11-09T08:47:16Z")

</div>

I think the config should be supported, but you could also try

```auto
revision: 3
outputs:
  default:
    type: elasticsearch
    hosts:
      - 10.172.211.30:9200
    protocol: https
    username: '{ES_USERNAME}'
    password: '{ES_PASSWORD}'

```

---

<div class="post-metadata">

**Author:** ![grillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grillo/32/84079_2.png) [@grillo](https://discuss.elastic.co/u/grillo)\
**Post date:** [November 10, 2022, 7:34am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/3 "2022-11-10T07:34:40Z")

</div>

Morning,

I have made the changes but it is the same result

```auto
[WARN][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [elastic-vm-1] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/10.172.211.30:9200, remoteAddress=/192.168.254.20:12379}

```

---

<div class="post-metadata">

**Author:** ![grillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grillo/32/84079_2.png) [@grillo](https://discuss.elastic.co/u/grillo)\
**Post date:** [November 10, 2022, 8:32am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/4 "2022-11-10T08:32:25Z")

</div>

Hi,

Sorry - error my. edit bad file configuration.

OK. I correct. the result has changed. now it gives me error in the ssl certificate.

```auto
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

```

I've added

```auto
cacert: 'ca.crt'

```

The service doesn't start - I guess I'm using an inappropriate command. How do I indicate the location of the ca.crt that must be used for communication?

thank you

---

<div class="post-metadata">

**Author:** ![lesio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lesio/32/89323_2.png) [@lesio](https://discuss.elastic.co/u/lesio)\
**Post date:** [November 10, 2022, 11:54am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/5 "2022-11-10T11:54:45Z")

</div>

You need to provide the `ssl` section, read more in the [docs](https://www.elastic.co/guide/en/fleet/current/elasticsearch-output.html#output-elasticsearch-pki-certs-authentication-settings)

---

<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:** [December 8, 2022, 11:55am UTC](https://discuss.elastic.co/t/elastic-agent-add-error-protocol-integration-http-https/318401/6 "2022-12-08T11:55:24Z")

</div>

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