title: Logstash not able to connect secured (ssl) Elastic search cluster
body: <p>I have installed Logstash,elasticsearch and kibana in single instance and installed X-pack also for TLS communication. enabled ssl communication in elasticsearch and kibana working good but logstash unable to connect elasticsearch , but i can curl elasticsearch url <a href="https://localhost:9200" rel="nofollow noreferrer">https://localhost:9200</a> there is no firewall blocking also, 
  I have generated open ssl certificate and key file  and kept in elasticsearch </p>
  
  <pre><code>input {
    beats {
       client_inactivity_timeout =&gt; 1000
       port =&gt; 5044
    }
  }
  
  filter {
    grok {
      match =&gt; [ "message", "%{TIMESTAMP_ISO8601} %{LOGLEVEL:loglevel} zeppelin IDExtractionService transactionId %{WORD:transaction_id} operation %{WORD:otype} received request duration %{NUMBER:duration} exception %{WORD:error}" ]
    }
  }
  filter {
      if "beats_input_codec_plain_applied" in [tags] {
          mutate {
              remove_tag =&gt; ["beats_input_codec_plain_applied"]
          }
      }
  }
  
  filter {
      if "_grokparsefailure" in [tags] {
          mutate {
              remove_tag =&gt; ["_grokparsefailure"]
          }
      }
  }
  
  xpack.monitoring.enabled: true
  xpack.monitoring.elasticsearch.url: https://localhost:9200
  output {
    elasticsearch {
      hosts =&gt; ["http://localhost:9200"]
      user =&gt; elastic
      password =&gt; password
      manage_template =&gt; false
  #    ssl_certificate_verification =&gt; false
      ssl =&gt; true
      cacert =&gt; '/etc/elasticsearch/ca/key.pem'
      index =&gt; "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
  
    }
  }
  </code></pre>
  
  <p>elastic search config file </p>
  
  <pre><code>cluster.name: my-application
  network.host: 0.0.0.0
  xpack.security.http.ssl.enabled: true
  xpack.security.http.ssl.key:  /opt/elasticsearch/ca/ca.key
  xpack.security.http.ssl.certificate: /opt/elasticsearch/ca/ca.crt
  </code></pre>
  
  <p>logstash log files</p>
  
  <pre><code>[2018-05-16T05:28:16,421][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=&gt;"http://logstash_system:xxxxxx@localhost:9200/", :error_type=&gt;LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=&gt;"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@localhost:9200/][Manticore::ClientProtocolException] localhost:9200 failed to respond"}
  [2018-05-16T05:28:17,201][WARN ][logstash.shutdownwatcher ] {"inflight_count"=&gt;1, "stalling_thread_info"=&gt;{"other"=&gt;[{"thread_id"=&gt;24, "name"=&gt;nil, "current_call"=&gt;"[...]/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/interval.rb:89:in `sleep'"}]}}
  [2018-05-16T05:28:21,422][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=&gt;http://logstash_system:xxxxxx@localhost:9200/, :path=&gt;"/"}
  [2018-05-16T05:28:21,422][INFO ][logstash.licensechecker.licensereader] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=&gt;http://logstash_system:xxxxxx@localhost:9200/, :path=&gt;"/"}
  [2018-05-16T05:28:21,424][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=&gt;"http://logstash_system:xxxxxx@localhost:9200/", :error_type=&gt;LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=&gt;"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@localhost:9200/][Manticore::ClientProtocolException] localhost:9200 failed to respond"}
  [2018-05-16T05:28:21,425][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=&gt;"http://logstash_system:xxxxxx@localhost:9200/", :error_type=&gt;LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=&gt;"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@localhost:9200/][Manticore::ClientProtocolException] localhost:9200 failed to respond"}
  [2018-05-16T05:28:22,202][WARN ][logstash.shutdownwatcher ] {"inflight_count"=&gt;1, "stalling_thread_info"=&gt;{"other"=&gt;[{"thread_id"=&gt;24, "name"=&gt;nil, "current_call"=&gt;"[...]/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/interval.rb:89:in `sleep'"}]}}
  [2018-05-16T05:28:26,425][INFO ][logstash.licensechecker.licensereader] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=&gt;http://logstash_system:xxxxxx@localhost:9200/, :path=&gt;"/"}
  [2018-05-16T05:28:26,426][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=&gt;http://logstash_system:xxxxxx@localhost:9200/, :path=&gt;"/"}
  [2018-05-16T05:28:26,427][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=&gt;"http://logstash_system:xxxxxx@localhost:9200/", :error_type=&gt;LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=&gt;"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@localhost:9200/][Manticore::ClientProtocolException] localhost:9200 failed to respond"}
  [2018-05-16T05:28:26,427][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=&gt;"http://logstash_system:xxxxxx@localhost:9200/", :error_type=&gt;LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=&gt;"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@localhost:9200/][Manticore::ClientProtocolException] localhost:9200 failed to respond"}
  [2018-05-16T05:28:27,201][WARN ][logstash.shutdownwatcher ] {"inflight_count"=&gt;1, "stalling_thread_info"=&gt;{"other"=&gt;[{"thread_id"=&gt;24, "name"=&gt;nil, "current_call"=&gt;"[...]/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/interval.rb:89:in `sleep'"}]}}
  root@5c417caecc5f:/var/log/logstash#
  </code></pre>