# ERR SSL client failed to connect with: dial tcp x.x.x.x:5043: getsockopt: connection refused

**URL:** <https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584>\
**Category:** Beats\
**Created:** [February 24, 2016, 12:01pm UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584 "2016-02-24T12:01:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsimran](https://avatars.discourse-cdn.com/v4/letter/h/71e660/32.png) [@harsimran](https://discuss.elastic.co/u/harsimran)\
**Post date:** [February 24, 2016, 12:01pm UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584/1 "2016-02-24T12:01:44Z")

</div>

I'm encounter a issue with the topbeat. I tried to ship the logs to logstash server on port 5043 and getting below on the client, while starting the topbeat. Both are rhel-6.5 virtual machines.

1. logstash is running and able to telnet with logstash port 5043.
2. firewall is off on both machines.
3. selinux is disabled.
4. copied the certificate on the client machine.
5. logstash conf file:

```auto
 input {
  beats {
    port => 5043
    type => "logs"
    ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
    ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
  }
}
output {
  elasticsearch { host => localhost }
  stdout { codec => rubydebug }
}

```

1. topbeat config file:

```auto
input:
  # In seconds, defines how often to read server statistics
  period: 10
  # Regular expression to match the processes that are monitored
  # By default, all the processes are monitored
  procs: [".*"]
  # Statistics to collect (all enabled by default)
  stats:
    # per system statistics, by default is true
    system: true
    # per process statistics, by default is true
    proc: true
    # file system information, by default is true
    filesystem: true
    # cpu usage per core, by default is false
    cpu_per_core: false
output:
   logstash:
    hosts: ["x.x.x.x:5043"]
    index: topbeat
    tls:
      certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"]
logging:
    rotateeverybytes: 10485760 # = 10MB

```

please help to solve this issue.

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [February 24, 2016, 5:02pm UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584/2 "2016-02-24T17:02:03Z")

</div>

Do you get any errors from topbeat or logstash? One thing that I noticed is that you didn't enable SSL on the Logstash side. Try adding `ssl => true`.

---

<div class="post-metadata">

**Author:** ![harsimran](https://avatars.discourse-cdn.com/v4/letter/h/71e660/32.png) [@harsimran](https://discuss.elastic.co/u/harsimran)\
**Post date:** [February 25, 2016, 4:33am UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584/3 "2016-02-25T04:33:55Z")

</div>

I tried with the same but the output is same.

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 25, 2016, 10:40am UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584/4 "2016-02-25T10:40:04Z")

</div>

is remote host accessible? Can you try ping and telnet into remote host with given port? Any firewall rules?

---

<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 5, 2017, 9:55pm UTC](https://discuss.elastic.co/t/err-ssl-client-failed-to-connect-with-dial-tcp-x-x-x-x-5043-getsockopt-connection-refused/42584/5 "2017-07-05T21:55:24Z")

</div>


