// loop while more writes required to complete handshake
while (needToCompleteHandshake()) {
try {
handshake(nextFilter);
} catch (SSLException ssle) {
SSLException newSSLE = new SSLHandshakeException(
"SSL handshake failed.");
newSSLE.initCause(ssle);
throw newSSLE;
}
if (getOutNetBuffer().hasRemaining()) {
if (SessionLog.isDebugEnabled(session)) {
SessionLog.debug(session, " write outNetBuffer2: "