AMQ-8169: Synchronize on serviceRead inside NIOSSLTransport

This is needed to prevent concurrent access to the SSLEngine during
initialization. This is a regression from when auto+nio+ssl was added.
This commit is contained in:
Christopher L. Shannon (cshannon) 2021-03-08 11:27:54 -05:00
parent 2f40261362
commit 1654e6c79c
2 changed files with 4 additions and 2 deletions

View File

@ -158,8 +158,9 @@ public class AutoInitNioSSLTransport extends NIOSSLTransport {
return readSize;
}
//Prevent concurrent access to SSLEngine
@Override
public void serviceRead() {
public synchronized void serviceRead() {
try {
if (handshakeInProgress) {
doHandshake();

View File

@ -243,8 +243,9 @@ public class NIOSSLTransport extends NIOTransport {
}
}
//Prevent concurrent access to SSLEngine
@Override
public void serviceRead() {
public synchronized void serviceRead() {
try {
if (handshakeInProgress) {
doHandshake();