[ 
https://issues.apache.org/jira/browse/KAFKA-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630099#comment-17630099
 ] 

tony mancill commented on KAFKA-8154:
-------------------------------------

We have observed this this behavior when using either Conscrypt or BouncyCastle 
as SSL providers.  For Conscrypt, we patched around this by changing the 
implementation of getApplicationBufferSize() from:
{code:java}
@Override
public int getApplicationBufferSize() {
    return NativeConstants.SSL3_RT_MAX_PLAIN_LENGTH;
}{code}
to
{code:java}
@Override
public int getApplicationBufferSize() {
    return NativeConstants.SSL3_RT_MAX_PLAIN_LENGTH - 
NativeConstants.SSL3_RT_HEADER_LENGTH;
} {code}
 

However we don't have a work-around for BouncyCastle, and the simple 1-line 
patch from [~vineethgn] to call ensureCapacity() seems far preferable.  It also 
matches the code used [during the 
handshake|https://github.com/apache/kafka/blob/2.8.1/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java#L371]
 in SslTransportLayer, which was patched as part of KAFKA-5920 in this commit:  
[https://github.com/apache/kafka/commit/d60f011d77ce80a44b02d43bf0889a50a8797dcd]
 

What would help get some eyes on this issue?  Should we submit a PR?

> Buffer Overflow exceptions between brokers and with clients
> -----------------------------------------------------------
>
>                 Key: KAFKA-8154
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8154
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 2.1.0
>            Reporter: Rajesh Nataraja
>            Priority: Major
>         Attachments: server.properties.txt
>
>
> https://github.com/apache/kafka/pull/6495
> https://github.com/apache/kafka/pull/5785



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to