Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1073

NioSocketSession#isSecured does not comply with interface contract

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.16
    • 2.0.17
    • Core, SSL
    • None

    Description

      The interface definition of org.apache.mina.core.session.IoSession#isSecured reads:

      return true if the session has started and initialized a SslEngine, false if the session is not yet secured (the handshake is not completed) or if SSL is not set for this session, or if SSL is not even an option.

      The implementation of org.apache.mina.transport.socket.nio.NioSocketSession#isSecured however, already returns true when the handshake is not completed.

      The provided patch fixes this, by adding an additional check to SslFilter that mimics the signature if isSecured. There's a bit of duplicated code, that might be improved upon.

      Attachments

        1. secured.patch
          2 kB
          Guus der Kinderen

        Activity

          Patch applied with http://git-wip-us.apache.org/repos/asf/mina/commit/38c83b5c (except the part that makes one test fails - cf DIRMINA-1072)

          Many thanks !

          elecharny Emmanuel Lécharny added a comment - Patch applied with http://git-wip-us.apache.org/repos/asf/mina/commit/38c83b5c (except the part that makes one test fails - cf DIRMINA-1072 ) Many thanks !

          People

            Unassigned Unassigned
            guus.der.kinderen Guus der Kinderen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: