# \[Logstash\] SSL TCP input certificate issue

**URL:** https://discuss.elastic.co/t/logstash-ssl-tcp-input-certificate-issue/328220
**Category:** Logstash
**Created:** [March 22, 2023, 8:39am UTC](https://discuss.elastic.co/t/logstash-ssl-tcp-input-certificate-issue/328220 "2023-03-22T08:39:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![perezdev](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@perezdev](https://discuss.elastic.co/u/perezdev)
#### Post date: [March 22, 2023, 8:39am UTC](https://discuss.elastic.co/t/logstash-ssl-tcp-input-certificate-issue/328220/1 "2023-03-22T08:39:17Z")

</div>

Hello,

I'm trying to setup an SSL TCP input config file in Logstash to receive logs from other syslog server over TLS 1.2. For the certificates I have created the following files using openssl:

```auto
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout cert.key -out cert.crt
openssl rsa -in cert.key -text > cert_priv.pem
openssl x509 -inform PEM -in cert.crt > cert_pub.pem

```

This is the Logstash input configuration:

```auto
input {
  tcp {
    type => "lines"
    port => 9910
    ssl_enable => true
    ssl_cert => "/cert_pub.pem"
    ssl_key => "/cert_priv.pem"
    ssl_key_passphrase => "$KEYPASS"
    ssl_verify => false
  }
}

```

When the syslog servers tries to establish the connection or send information I get the following SSLHandshakeException:

```auto
[2023-03-22T08:23:56,592][ERROR][logstash.inputs.tcp][main][69b65a79f6f28252bb4b3a14ef8e05032d5692014aee28f4119d4316e5048341] /IP:53313: closing due:
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca

```

Do you know what could be the issue?

Thank you.

---

<div class="post-metadata">

### Author: ![perezdev](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@perezdev](https://discuss.elastic.co/u/perezdev)
#### Post date: [March 23, 2023, 3:00pm UTC](https://discuss.elastic.co/t/logstash-ssl-tcp-input-certificate-issue/328220/2 "2023-03-23T15:00:44Z")

</div>

Hello,

any help with this issue?

Thanks.

---

<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: [April 20, 2023, 3:01pm UTC](https://discuss.elastic.co/t/logstash-ssl-tcp-input-certificate-issue/328220/3 "2023-04-20T15:01:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
