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

Matt Pavlovich commented on AMQ-8169:
-------------------------------------

{noformat}
   protected int secureRead(ByteBuffer plain) throws Exception {

        if (!(inputBuffer.position() != 0 && inputBuffer.hasRemaining()) || 
status == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
            int bytesRead = channel.read(inputBuffer);

            if (bytesRead == 0 && 
!(sslEngine.getHandshakeStatus().equals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP)))
 {
                return 0;
            }

            if (bytesRead == -1) {
                sslEngine.closeInbound();
                if (inputBuffer.position() == 0 || status == 
SSLEngineResult.Status.BUFFER_UNDERFLOW) {
                    return -1;
                }
            }
        }

        plain.clear();

        inputBuffer.flip();
        SSLEngineResult res;
        do {
            res = sslEngine.unwrap(inputBuffer, plain); // <-- exception thrown 
from this line
        } while (res.getStatus() == SSLEngineResult.Status.OK && 
res.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_UNWRAP
                && res.bytesProduced() == 0);

        if (res.getHandshakeStatus() == 
SSLEngineResult.HandshakeStatus.FINISHED) {
            finishHandshake();
        }
      ...
{noformat}

> StompNIOSSLTest test fails with more recent JDK 8 versions
> ----------------------------------------------------------
>
>                 Key: AMQ-8169
>                 URL: https://issues.apache.org/jira/browse/AMQ-8169
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.17.0
>            Reporter: Matt Pavlovich
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.17.0
>
>
> The StompNIOSSL test fails during CI/CD tests with certain JDK versions. This 
> blocks PR's from getting a green status
> To reproduce:
> [x] Fails with jdk1.8.0_281
> [x] Passes with jdk1.8.0_211
> Suspects:
> * The test SSL cert needs to be generated with a newer cipher and/or length 
> * The NIOSSLTransport has a bad byte[] read bug



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to