# Why is the default value of \`xpack.security.http.ssl.enabled\` in ElasticSearch's Docker Image set to \`true\`?

**URL:** <https://discuss.elastic.co/t/why-is-the-default-value-of-xpack-security-http-ssl-enabled-in-elasticsearchs-docker-image-set-to-true/366089>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, docker\
**Created:** [September 5, 2024, 9:48am UTC](https://discuss.elastic.co/t/why-is-the-default-value-of-xpack-security-http-ssl-enabled-in-elasticsearchs-docker-image-set-to-true/366089 "2024-09-05T09:48:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![linghengqian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linghengqian/32/103651_2.png) [@linghengqian](https://discuss.elastic.co/u/linghengqian)\
**Post date:** [September 5, 2024, 9:48am UTC](https://discuss.elastic.co/t/why-is-the-default-value-of-xpack-security-http-ssl-enabled-in-elasticsearchs-docker-image-set-to-true/366089/1 "2024-09-05T09:48:26Z")

</div>

- [Security settings in Elasticsearch | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#http-tls-ssl-settings) mentions that the default value of `xpack.security.http.ssl.enabled` is `false`.

> ([Static](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#static-cluster-setting)) Used to enable or disable TLS/SSL on the HTTP networking layer, which Elasticsearch uses to communicate with other clients. The default is `false` .

- This statement does not seem to be in line with Docker Image. Assume there is a `docker-compose.yaml` file like this. I use `Docker Engine 27.2.0` and `Docker Compose 2.29.2`.

```yaml
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
    environment:
      - ELASTIC_PASSWORD=es01Test
      - discovery.type=single-node

```

- I then booted up and entered the interactive prompt for the container.

```shell
docker compose up -d
docker compose exec es01 /bin/bash
curl -u elastic:es01Test \
  -X POST \
  http://es01:9200/_security/user/kibana_system/_password \
  -d '{"password":"'"kibanaTest"'"}' \
  -H 'Content-Type: application/json'

```

- At this point, the Error Log is as follows.

```shell
elasticsearch@5d304b927c85:~$ curl -u elastic:es01Test \
> -X POST \
> http://es01:9200/_security/user/kibana_system/_password \
> -d '{"password":"'"kibanaTest"'"}' \
> -H 'Content-Type: application/json'
curl: (52) Empty reply from server

```

- Just execute `exit` and `docker compose down --volumes` to remove all containers.
- If I explicitly set `xpack.security.http.ssl.enabled=false` in `docker-compose.yml`,

```yaml
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
    environment:
      - ELASTIC_PASSWORD=es01Test
      - discovery.type=single-node
      - xpack.security.http.ssl.enabled=false

```

- I then booted up and entered the interactive prompt for the container.

```shell
docker compose up -d
docker compose exec es01 /bin/bash
curl -u elastic:es01Test \
  -X POST \
  http://es01:9200/_security/user/kibana_system/_password \
  -d '{"password":"'"kibanaTest"'"}' \
  -H 'Content-Type: application/json'

```

- At this time, the exception `curl: (52) Empty reply from server` is no longer thrown.

```shell
elasticsearch@78f52664fc29:~$ curl -u elastic:es01Test \
> -X POST \
> http://es01:9200/_security/user/kibana_system/_password \
> -d '{"password":"'"kibanaTest"'"}' \
> -H 'Content-Type: application/json'
{}elasticsearch@78f52664fc29:~$ 

```

- Why is the default value of `xpack.security.http.ssl.enabled` in Elasticsearch's Docker Image set to `true`? 🤔

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [September 5, 2024, 11:26am UTC](https://discuss.elastic.co/t/why-is-the-default-value-of-xpack-security-http-ssl-enabled-in-elasticsearchs-docker-image-set-to-true/366089/2 "2024-09-05T11:26:21Z")

</div>

> [@linghengqian](#):
>
> Why is the default value of `xpack.security.http.ssl.enabled` in Elasticsearch's Docker Image set to `true`? 🤔

It's not (or at least, not exactly in those terms).

On startup, if you have not performed any security configuration, elasticsearch will [auto configure security](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-stack-security.html) and write an updated `elasticsearch.yml` that turns on SSL for transport and http.

You can disable this by either:

- setting `xpack.security.autoconfiguration.enabled` to `false`
- configuring some part of security yourself (which can be as simple as setting `xpack.security.enabled` to `true`).
