This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-j.git

commit 226394d4c0a0983f6b9ff16dfcb4e44efe30e353
Author: Robbie Gemmell <[email protected]>
AuthorDate: Fri Jul 31 17:04:58 2026 +0100

    PROTON-2943: make allowSkip opt-in rather than opt-out
---
 .../apache/qpid/proton/engine/impl/SaslImpl.java   |  2 +-
 .../apache/qpid/proton/systemtests/SaslTest.java   | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git 
a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java 
b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
index 01c34d12..1263fd62 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
@@ -84,7 +84,7 @@ public class SaslImpl implements Sasl, 
SaslFrameBody.SaslFrameBodyHandler<Void>,
     private Symbol _chosenMechanism;
 
     private Role _role;
-    private boolean _allowSkip = true;
+    private boolean _allowSkip = false;
 
     private SaslListener _saslListener;
 
diff --git 
a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java 
b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
index 714747df..b7b8001a 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
@@ -470,6 +470,28 @@ public class SaslTest extends EngineTestBase
         assertEquals(0, saslBodies.size());
     }
 
+    @Test
+    public void testSaslRequiredRefusesBare() throws Exception
+    {
+        getClient().transport = Proton.transport();
+        getServer().transport = Proton.transport();
+
+        Sasl serverSasl = getServer().transport.sasl();
+        serverSasl.server();
+        serverSasl.setMechanisms(TESTMECH1, TESTMECH2);
+        assertEquals("Server should not yet know the remote's chosen 
mechanism.",
+                     0,
+                     serverSasl.getRemoteMechanisms().length);
+
+        try {
+            pumpClientToServer();
+            fail("Expected exception");
+        } catch (TransportException te) {
+            assertNotNull(te.getMessage());
+            assertTrue(te.getMessage().contains("AMQP SASL header mismatch 
value 0, expecting 3. In state: HEADER4"));
+        }
+    }
+
     private byte[] fillBytes(String seedString, int length)
     {
         byte[] seed = seedString.getBytes(StandardCharsets.UTF_8);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to