# Secure cURL connections and HTTP connections

**URL:** https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134
**Category:** Elasticsearch
**Created:** [November 23, 2019, 2:03am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134 "2019-11-23T02:03:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![louisdeveloper](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@louisdeveloper](https://discuss.elastic.co/u/louisdeveloper)
#### Post date: [November 23, 2019, 2:03am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134/1 "2019-11-23T02:03:57Z")

</div>

I currently use ElasticSearch 6. \* installed on my server.  
In it I make cURL connections and access via HTTP directly, without having to enter username and password, just sending the request with HTTP to create and search documents.

For security I restricted the IPs that can access this server.

How do I make these connections require HTTP Basic Authentication, always having to pass a username and password?

I checked the X-Pack, but as I understand it, this type of feature requires a payment to use it. Am I correct or is there another alternative to enable this basic authentication?

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 23, 2019, 2:15am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134/2 "2019-11-23T02:15:19Z")

</div>

Actually Basic authentication is part of the Basic (Free) feature set. See [here](https://www.elastic.co/subscriptions)

As long as you downloaded the default distribution from Elastic Basic security is included.

Here is a [Blog](https://www.elastic.co/blog/default-security-for-elasticsearch-and-the-elastic-stack) on the topic.

---

<div class="post-metadata">

### Author: ![louisdeveloper](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@louisdeveloper](https://discuss.elastic.co/u/louisdeveloper)
#### Post date: [November 23, 2019, 2:49am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134/3 "2019-11-23T02:49:24Z")

</div>

Thank you for the informations.

In this case I should just run this command on my server, correct?

`bin/elasticsearch-setup-passwords interactive -u "http://localhost:9201"`

---

<div class="post-metadata">

### Author: ![Rudd5TT](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@Rudd5TT](https://discuss.elastic.co/u/Rudd5TT)
#### Post date: [November 23, 2019, 5:44am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134/4 "2019-11-23T05:44:44Z")

</div>

Thank you for reaching out,  
this information will surely help me!!!

---

<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 21, 2019, 5:44am UTC](https://discuss.elastic.co/t/secure-curl-connections-and-http-connections/209134/5 "2019-12-21T05:44:44Z")

</div>

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