# Elasticsearch return connection refused after initialization SearchGuard

**URL:** <https://forum.search-guard.com/t/elasticsearch-return-connection-refused-after-initialization-searchguard/1025>\
**Category:** Search Guard\
**Created:** [July 19, 2018, 2:00pm UTC](https://forum.search-guard.com/t/elasticsearch-return-connection-refused-after-initialization-searchguard/1025 "2018-07-19T14:00:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![1119](https://avatars.discourse-cdn.com/v4/letter/1/dfb087/32.png) [@1119](https://forum.search-guard.com/u/1119)\
**Post date:** [July 19, 2018, 2:00pm UTC](https://forum.search-guard.com/t/elasticsearch-return-connection-refused-after-initialization-searchguard/1025/1 "2018-07-19T14:00:08Z")

</div>

Hi,

After we install and initialize Search Guard with demo scripts

```auto
install_demo_configuration.sh

```

and

```auto
sgadmin_demo.sh

```

we try to connect Elasticsearch, and get error

curl: (7) Failed to connect to hostname port 9200: Connection refused

- Search Guard and Elasticsearch version: 6.3.1

- operating system: ubuntu 14.04.5

- Search Guard configuration files

- Other installed Elasticsearch or Kibana plugins, if any: x-pack

Best regards,

Oleh Kayda

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [July 19, 2018, 8:39pm UTC](https://forum.search-guard.com/t/elasticsearch-return-connection-refused-after-initialization-searchguard/1025/2 "2018-07-19T20:39:21Z")

</div>

What is the curl command you are using? The demo installer will a) enable HTTPS and b) will install self-signed demo certificates.

So make sure you connect with HTTPS and provide the --insecure flag to curl to accept self-signed certificates.

> **···**
>
> On Thursday, July 19, 2018 at 4:00:08 PM UTC+2, Олег Кайда wrote:
> 
> > Hi,
> 
> > 
> 
> > 
> 
> > After we install and initialize Search Guard with demo scripts
> 
> > ```auto
> > install_demo_configuration.sh
> > 
> > ```
> 
> > and
> 
> > ```auto
> > sgadmin_demo.sh
> > 
> > ```
> 
> > 
> 
> > we try to connect Elasticsearch, and get error
> 
> > curl: (7) Failed to connect to hostname port 9200: Connection refused
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > - Search Guard and Elasticsearch version: 6.3.1
> 
> > - operating system: ubuntu 14.04.5
> 
> > - Search Guard configuration files
> 
> > - Other installed Elasticsearch or Kibana plugins, if any: x-pack
> 
> > 
> 
> > Best regards,
> 
> > Oleh Kayda
