diff --git a/CHANGELOG.md b/CHANGELOG.md index 872c05f..4cffa66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 3.0.6 - Change codec instance comparison [#69](https://github.com/logstash-plugins/logstash-output-syslog/pull/69) - Added support for RFC5424 structured data [#67](https://github.com/logstash-plugins/logstash-output-syslog/pull/67) + - The SNI (Server Name Indication) extension is now used when connecting to syslog server with TLS and `host` is set to FQDN (Fully Qualified Domain Name) [#66](https://github.com/logstash-plugins/logstash-output-syslog/pull/66) ## 3.0.5 - Docs: Set the default_codec doc attribute. diff --git a/lib/logstash/outputs/syslog.rb b/lib/logstash/outputs/syslog.rb index d3ae6ca..7ea7465 100644 --- a/lib/logstash/outputs/syslog.rb +++ b/lib/logstash/outputs/syslog.rb @@ -218,6 +218,8 @@ def connect socket = TCPSocket.new(@host, @port) if ssl? socket = OpenSSL::SSL::SSLSocket.new(socket, @ssl_context) + # Use SNI extension + socket.hostname = @host begin socket.connect rescue OpenSSL::SSL::SSLError => ssle