# Elasticsearch input plugin not working over ssl

**URL:** <https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051>\
**Category:** Logstash\
**Created:** [August 26, 2016, 3:45pm UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051 "2016-08-26T15:45:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marke72](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marke72/32/10832_2.png) [@marke72](https://discuss.elastic.co/u/marke72)\
**Post date:** [August 26, 2016, 3:45pm UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051/1 "2016-08-26T15:45:15Z")

</div>

So I have Logstash outputting to Elasticsearch through SSL. It's working great. Haven't had an issue with that.  
I am currently trying to redo an index (reindex) using Logstash where you use both the elasticsearch input plugin and the elasticsearch output plugin. I've changed some stuff in the template which is why I want to do this. Anyway I have it set up basically exactly the same as the output plugin but I get an error:

```
A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::Elasticsearch ssl=>true, user=>"user", password=><password>, hosts=>["https://elasticsearch.domain.net"], index=>"index-2016.08.04", codec=><LogStash::Codecs::JSON charset=>"UTF-8">, query=>"{\"query\": { \"match_all\": {} } }", scan=>true, size=>1000, scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"]>
  Error: initialize: name or service not known {:level=>:error}

```

I can ping [elasticsearch.domain.net](http://elasticsearch.domain.net) so it doesn't seem like it's a connection issue. Checking the logs on [elasticsearch.wadafarms.net](http://elasticsearch.wadafarms.net) I don't see anything that would point to the issue. I'm using the same exact configuration for my output as I do in all my other configuration files which work. It's just the input plugin doesn't seem to like SSL or something. If I don't use SSL, it works just fine but I had to change things around to get that to work which I would prefer to not have to do if I ever do need to reindex again. Anyone have any ideas? Thanks!  
Here's my configuration:

```
input {
  elasticsearch {
    ssl => true
    user => "user"
    password => "password"
    hosts => ["https://elasticsearch.domain.net"]
    index => "index-2016.08.04"
  }
}

output {
  elasticsearch {
    ssl => true
    user => "user"
    password => "password"
    hosts => ["https://elasticsearch.domain.net"]
    index => "index-2016.08.04v2"
    manage_template => false
  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 30, 2016, 5:55pm UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051/2 "2016-08-30T17:55:58Z")

</div>

Your inclusion of "http://" in the `hosts` option isn't consistent with the accepted forms listed in the documentation.

---

<div class="post-metadata">

**Author:** ![marke72](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marke72/32/10832_2.png) [@marke72](https://discuss.elastic.co/u/marke72)\
**Post date:** [September 9, 2016, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051/3 "2016-09-09T14:34:15Z")

</div>

Thank you! That was part of my problem. I started getting a `certificate verify failed` error. So I downloaded the certificate and added the option `ca_file`. It worked after that.  
My question about the input plugin now is where does the it look for certificates? When I set up SSL for the output plugin, all I had to do was import the certificate into the Java keystore. But that obviously doesn't work for the input plugin. Is the `ca_file` option required when `ssl` is set to true? Or is there some place I can import the certificate to not need the `ca_file` option?

---

<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, 4:39am UTC](https://discuss.elastic.co/t/elasticsearch-input-plugin-not-working-over-ssl/59051/4 "2017-07-06T04:39:04Z")

</div>


