Received plaintext traffic on an encrypted channel closing connection – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch receives unencrypted (plaintext) traffic on a channel that is configured to handle encrypted (HTTPS) traffic. This could be due to a misconfiguration in the client sending the requests or in the Elasticsearch server itself. To resolve this issue, ensure that the client is sending requests over HTTPS. If the server is incorrectly configured, you may need to adjust the Elasticsearch.yml configuration file to correctly handle HTTPS traffic. Also, check if the correct SSL certificates are in place and are correctly referenced in the configuration.

This guide will help you check for common problems that cause the log ” received plaintext traffic on an encrypted channel; closing connection {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “received plaintext traffic on an encrypted channel; closing connection {}” classname is SecurityTransportExceptionHandler.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

    public void accept(TcpChannel channel; Exception e) {
        if (lifecycle.started() == false) {
            // just close and ignore - we are already stopped and just need to make sure we release all resources
            CloseableChannel.closeChannel(channel);
        } else if (SSLExceptionHelper.isNotSslRecordException(e)) {
            logger.warn("received plaintext traffic on an encrypted channel; closing connection {}"; channel);
            CloseableChannel.closeChannel(channel);
        } else if (SSLExceptionHelper.isCloseDuringHandshakeException(e)) {
            logger.debug("connection {} closed during handshake"; channel);
            CloseableChannel.closeChannel(channel);
        } else if (SSLExceptionHelper.isInsufficientBufferRemainingException(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?