# How to setup ElasticSearch-Hadoop to work thru HTTPS?

**URL:** https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [March 2, 2016, 2:43am UTC](https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187 "2016-03-02T02:43:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Galeyev](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Galeyev](https://discuss.elastic.co/u/Galeyev)
#### Post date: [March 2, 2016, 2:43am UTC](https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187/1 "2016-03-02T02:43:10Z")

</div>

Hello,

I'm setting up a elasticsearch-hadoop connector to pull data to hadoop. I wrote a mapper/reducer job for it and tested on my dev box, where elasticsearch set up on a default 9200 port at [http://localhost:9200](http://localhost:9200). However, the prod version is deployed at http://{url}/{prefix} and it's not clear how to properly set job settings in this case. I tried:

```
	conf.set("es.nodes", "{url}");
	conf.set("es.port", "443");
	conf.set("es.nodes.path.prefix", "{prefix}");

```

however, it fails with:

> Exception in thread "main" org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[10.205.12.97:443]]

I also tried to specify:

```
	conf.set("es.nodes", "{url}");
	conf.set("es.port", "80");
	conf.set("es.nodes.path.prefix", "{prefix}");
	conf.set("es.net.ssl.protocol","true");
	conf.set("es.net.ssl", "true");

```

, however it fails with:

```
 Exception in thread "main" org.elasticsearch.hadoop.EsHadoopIllegalStateException: Cannot instantiate SSL - true SSLContext not available
	at org.elasticsearch.hadoop.rest.commonshttp.SSLSocketFactory.createSSLContext(SSLSocketFactory.java:163)

```

What would be the right way to configure elasticsearch-hadoop connector to work with elasticsearch over https?

Thank you.

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [March 3, 2016, 9:58am UTC](https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187/2 "2016-03-03T09:58:54Z")

</div>

So ES is deployed under `http://somehost/someprefix/` right?

In this case why use `es.port` 443? Since you are using http it should be port 80. If you made a typo and used `https` then make sure to specify `es.net.ssl`;`es.net.ssl.protocol` true is an invalid setting.

Take a step back and check out the [configuration](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html) page; it gives an example on what options you have available. For example, the SSL options are discussed [here](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html#_ssl) and security over all [here](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/security.html).

Also the docs contain a section on troubleshooting which you might find handy.

---

<div class="post-metadata">

### Author: ![Galeyev](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Galeyev](https://discuss.elastic.co/u/Galeyev)
#### Post date: [March 22, 2016, 7:38pm UTC](https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187/3 "2016-03-22T19:38:01Z")

</div>

@costin, thank you very much for your response, it helped to solve the problem. Yes, there was a typo, I used https and also incorrectly used `es.net.ssl.protocol` property.

---

<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: [July 6, 2017, 1:25pm UTC](https://discuss.elastic.co/t/how-to-setup-elasticsearch-hadoop-to-work-thru-https/43187/4 "2017-07-06T13:25:34Z")

</div>


