# Elasticsearch with ingress received plaintext http traffic on an https channel

**URL:** <https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 27, 2020, 5:30am UTC](https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549 "2020-08-27T05:30:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcanales](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcanales/32/74568_2.png) [@dcanales](https://discuss.elastic.co/u/dcanales)\
**Post date:** [August 27, 2020, 5:30am UTC](https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549/1 "2020-08-27T05:30:56Z")

</div>

Hi, i have the config from [https://github.com/elastic/helm-charts/tree/7.9/elasticsearch/examples/security](https://github.com/elastic/helm-charts/tree/7.9/elasticsearch/examples/security)

with the next ingress in my values.yaml:

```auto
ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: nginx
  path: /
  hosts:
    - elasticsearch.mycompany.cloud
  tls:
  - hosts:
    - elasticsearch.mycompany.cloud
    secretName: mycompany.cloud-prod-tls

```

log from curl inside pod

```auto
curl -sku elastic:2063password https://localhost:9200
{
  "name" : "elasticsearch-master-0",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "huhZtorGTEOhX3gO41sNGg",
  "version" : {
    "number" : "7.9.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "a479a2a7fce0389512d6a9361301708b92dff667",
    "build_date" : "2020-08-11T21:36:48.204330Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

when try to reach elasticsearch from outside

```auto
curl -sku elastic:2063password https://elasticsearch.mycompany.cloud     
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.17.10</center>
</body>
</html>

```

log from elasticsearch

```auto
{"type": "server", "timestamp": "2020-08-27T05:26:02,526Z", "level": "WARN", "component": "o.e.x.s.t.n.SecurityNetty4HttpServerTransport", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/10.42.3.81:9200, remoteAddress=/172.31.44.44:49490}", "cluster.uuid": "huhZtorGTEOhX3gO41sNGg", "node.id": "cza-R9qVQYmqCs8s18mqHw" }

```

---

<div class="post-metadata">

**Author:** ![lfreitas](https://avatars.discourse-cdn.com/v4/letter/l/ac8455/32.png) [@lfreitas](https://discuss.elastic.co/u/lfreitas)\
**Post date:** [August 31, 2020, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549/2 "2020-08-31T15:21:38Z")

</div>

Having the same issue!

---

<div class="post-metadata">

**Author:** ![lfreitas](https://avatars.discourse-cdn.com/v4/letter/l/ac8455/32.png) [@lfreitas](https://discuss.elastic.co/u/lfreitas)\
**Post date:** [September 2, 2020, 1:47pm UTC](https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549/3 "2020-09-02T13:47:56Z")

</div>

It worked for me using these annotations in Ingress:

```
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
nginx.ingress.kubernetes.io/secure-backends: "true"
ingress.kubernetes.io/ssl-passthrough: "true"
```

---

<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:** [September 30, 2020, 1:48pm UTC](https://discuss.elastic.co/t/elasticsearch-with-ingress-received-plaintext-http-traffic-on-an-https-channel/246549/4 "2020-09-30T13:48:08Z")

</div>

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