fluentd is not able to connect to elasticsearch SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)

Viewed 1800

I'm trying to install fluentd on Ubuntu 18.04(aws lightsail) in order to send nginx, uwsgi logs to elasticsearch(elastic cloud). But, I keep getting the same error below.

    2019-10-18 14:55:35 +0900 [info]: starting fluentd-1.7.3 pid=29978 ruby="2.5.1"
    2019-10-18 14:55:35 +0900 [info]: spawn command to main:  cmdline=["/usr/bin/ruby2.5", "-Eascii-8bit:ascii-8bit", "/usr/local/bin/fluentd", "-c", "fluent.conf", "--under-supervisor"]
    2019-10-18 14:55:36 +0900 [info]: gem 'fluent-plugin-elasticsearch' version '3.5.5'
    2019-10-18 14:55:36 +0900 [info]: gem 'fluentd' version '1.7.3'
    2019-10-18 14:55:36 +0900 [info]: adding match pattern="**" type="elasticsearch"
    2019-10-18 14:55:38 +0900 [warn]: #0 Could not communicate to Elasticsearch, resetting connection and trying again. SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)

Fluentd Config file:

    cat fluent.conf 
    <source>
      @type tail
      path /home/kycho/fluentd/log/uwsgi.log
      pos_file /home/kycho/fluentd/log/fluentd/uwsgi.log.pos
      tag uwsgi.log
      format nginx
    </source>

    <match **>
      @type elasticsearch
      logstash_format true
      host 4e03bxxxxxxxxxxxxxxxxxxxx.ap-northeast-1.aws.found.io
      port: 9243
      username: elastic
      password: xxxxxxxxxxxxxxxxxxxx
      scheme https
      ssl_version TLSv1_2
      index_name nginx-fluentd
      type_name  nginx-fluentd
    </match>

Fluentd Version:

        fluentd 1.7.3
        openssl version
        OpenSSL 1.1.1  11 Sep 2018

When I changed ssl_version TLSv1_3, I got error given below. So, I tried all options (SSLv23,TLSv1,TLSv1_1,TLSv1_2) and the results were same.

    fluentd -c fluent.conf 
    2019-10-18 14:47:23 +0900 [info]: parsing config file is succeeded path="fluent.conf"
    2019-10-18 14:47:23 +0900 [error]: config error file="fluent.conf" error_class=Fluent::ConfigError error="valid options are SSLv23,TLSv1,TLSv1_1,TLSv1_2 but got TLSv1_3

I already have tried with td-agent, but was getting same error. Is openssl 1.1.1 is not compatible with tlsv1.2...?

0 Answers
Related