Program: 113667
Project: 113667
Buggy source:
/** 
 * creates a SSLChannelIO
 * @param channel channel, which should be protected by SSL
 * @param sslOptions the Options for the SSL-Connection
 * @param clientMode true, if you are a client; false, if you are a server
 * @throws SSLException
 */
public SSLChannelIO(SocketChannel channel,SSLOptions sslOptions,boolean clientMode) throws SSLException {
  super(channel);
  sslEngine=sslOptions.getSSLContext().createSSLEngine();
  sslEngine.setUseClientMode(clientMode);
  sslEngine.setNeedClientAuth(true);
  if (clientMode) {
    sslEngine.beginHandshake();
    handshakeStatus=HandshakeStatus.NEED_WRAP;
  }
 else {
    sslEngine.beginHandshake();
    handshakeStatus=HandshakeStatus.NEED_UNWRAP;
  }
  handshakeComplete=false;
  shutdownInProgress=false;
  int netBufSize=sslEngine.getSession().getPacketBufferSize();
  inNetBuffer=BufferPool.allocate(netBufSize);
  inReadBuffer=BufferPool.allocate(sslEngine.getSession().getApplicationBufferSize());
  outNetBuffer=BufferPool.allocate(netBufSize);
  dummyBuffer=BufferPool.allocate(netBufSize);
  sslEngine.setEnabledProtocols(sslEngine.getSupportedProtocols());
  if (sslOptions.isAuthenticationWithoutEncryption()) {
    if (supportedCipherSuitesWithoutEncryption == null) {
      ArrayList<String> cipherSuites=new ArrayList<String>();
      for (      String cipherSuite : sslEngine.getSupportedCipherSuites()) {
        if (cipherSuite.contains("String_Node_Str")) {
          cipherSuites.add(cipherSuite);
        }
      }
      supportedCipherSuitesWithoutEncryption=new String[cipherSuites.size()];
      supportedCipherSuitesWithoutEncryption=cipherSuites.toArray(supportedCipherSuitesWithoutEncryption);
    }
    sslEngine.setEnabledCipherSuites(supportedCipherSuitesWithoutEncryption);
  }
 else {
    sslEngine.setEnabledCipherSuites(sslEngine.getSupportedCipherSuites());
  }
}

Fixed version (ground truth):
/** 
 * creates a SSLChannelIO
 * @param channel channel, which should be protected by SSL
 * @param sslOptions the Options for the SSL-Connection
 * @param clientMode true, if you are a client; false, if you are a server
 * @throws SSLException
 */
public SSLChannelIO(SocketChannel channel,SSLOptions sslOptions,boolean clientMode) throws SSLException {
  super(channel);
  sslEngine=sslOptions.getSSLContext().createSSLEngine();
  sslEngine.setUseClientMode(clientMode);
  sslEngine.setNeedClientAuth(true);
  if (clientMode) {
    sslEngine.beginHandshake();
    handshakeStatus=HandshakeStatus.NEED_WRAP;
  }
 else {
    sslEngine.beginHandshake();
    handshakeStatus=HandshakeStatus.NEED_UNWRAP;
  }
  handshakeComplete=false;
  shutdownInProgress=false;
  int netBufSize=sslEngine.getSession().getPacketBufferSize();
  inNetBuffer=BufferPool.allocate(netBufSize);
  inReadBuffer=BufferPool.allocate(sslEngine.getSession().getApplicationBufferSize() * 2);
  outNetBuffer=BufferPool.allocate(netBufSize);
  dummyBuffer=BufferPool.allocate(netBufSize);
  sslEngine.setEnabledProtocols(sslEngine.getSupportedProtocols());
  if (sslOptions.isAuthenticationWithoutEncryption()) {
    if (supportedCipherSuitesWithoutEncryption == null) {
      ArrayList<String> cipherSuites=new ArrayList<String>();
      for (      String cipherSuite : sslEngine.getSupportedCipherSuites()) {
        if (cipherSuite.contains("String_Node_Str")) {
          cipherSuites.add(cipherSuite);
        }
      }
      supportedCipherSuitesWithoutEncryption=new String[cipherSuites.size()];
      supportedCipherSuitesWithoutEncryption=cipherSuites.toArray(supportedCipherSuitesWithoutEncryption);
    }
    sslEngine.setEnabledCipherSuites(supportedCipherSuitesWithoutEncryption);
  }
 else {
    sslEngine.setEnabledCipherSuites(sslEngine.getSupportedCipherSuites());
  }
}