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

SSL write blocked on Android

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.0.7
    • None
    • SSL
    • None
    • Android

    Description

      I'm developing an Android app using Apache Mina for network IO. Non-SSL connections (reading, writing) work fine, but as soon as I add an SSL filter things stop working. I also tried pure SSL sockets and they work fine.

      final byte[] TEST_TEXT = new byte[]{
      'a', '\n'
      };

      ......

      connectorTLSFilter = new SslFilter(BogusSslContextFactory
      .getInstance(false));
      connectorTLSFilter.setUseClientMode(true);
      connector.getFilterChain().addFirst("SSL", connectorTLSFilter);
      connector.setHandler(new MinaClientHandler());
      ConnectFuture future = connector.connect(new InetSocketAddress("192.168.0.10", 443));
      future.awaitUninterruptibly();
      Log.v("ssl", "handshake sucess");
      IoSession session = future.getSession();
      IoBuffer buf = IoBuffer.allocate(TEST_TEXT.length);
      buf.put(TEST_TEXT);
      buf.flip();
      Log.v("ssl","sending");
      session.write(buf).awaitUninterruptibly();
      Log.v("ssl","sent");

      =============================
      Blocked at "sending"

      Attachments

        Activity

          People

            Unassigned Unassigned
            zphreg zphreg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: