Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2490

SASL to AMQP handoff is unsuccessful in server contexts (e.g. for peer-to-peer)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • protonj2-1.0.0-M4
    • protonj2-1.0.0-M5
    • protonj2
    • None

    Description

      When using the engine in a server context, i.e., not the client classes, the SASL to AMQP handoff does not complete correctly leaving the ProtonFrameDecodingHandler in the incorrect to process the followup AMQPHeader message.

      The problem appears to be caused by the `handleWrite(..., SASLEnvelope)` and `handleRead(..., SASLEnvelope)` methods resetting the ProtonFrameDecodingHandler's pipeline interests to 'read only'. However, this occurs before it processes the write of the final SASL Outcome frame, which is used to reset the ProtonFrameDecodingHandler's state to handle the next incoming AMQPHeader frame.

      The ProtonFrameDecodingHandler needs to be modified such that it only resets the interest to read only once it has processed the SASLOutcome and not before (unless it is a non-SASL engine).

      As it stands, it prevents the ProtonJ2 library from being used out of the box in server contexts, which default to SASL engine configurations. A temporary workaround is to add an engine handler to the pipeline that listens to writes, searches the pipeline for the decoder, and forces its reset at the appropriate time.

      It is recommended that Unit Tests be written to cover the SASL to AMQP handover portion of the protocol (and possibly other state transitions currently missing) as the current test suite only tests some aspects of the SASL protocol and AMQP protocols independently.

      Attachments

        Activity

          People

            tabish Timothy A. Bish
            mattys101 Matt Selway
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: