Client did not trust this server s certificate closing connection – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when the Elasticsearch client cannot verify the SSL/TLS certificate of the server it’s trying to connect to. This could be due to a self-signed certificate, an expired certificate, or a certificate from an untrusted source. To resolve this issue, you can: 1) Replace the server’s certificate with one issued by a trusted Certificate Authority (CA). 2) If using a self-signed certificate, ensure the client is configured to trust this certificate. 3) Check the certificate’s validity period to ensure it hasn’t expired.

This guide will help you check for common problems that cause the log ” client did not trust this server’s certificate; closing connection {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, client.

Log Context

Log “client did not trust this server’s certificate; closing connection {}” classname is SecurityTransportExceptionHandler.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            CloseableChannel.closeChannel(channel);
        } else if (SSLExceptionHelper.isInsufficientBufferRemainingException(e)) {
            logger.debug("connection {} closed abruptly"; channel);
            CloseableChannel.closeChannel(channel);
        } else if (SSLExceptionHelper.isReceivedCertificateUnknownException(e)) {
            logger.warn("client did not trust this server's certificate; closing connection {}"; channel);
            CloseableChannel.closeChannel(channel);
        } else {
            fallback.accept(channel; e);
        }
    }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?