public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
writer = new SSLStreamWriter(connectionStreamWriter); final Future handshakeFuture = writer.handshake(reader, clientSSLEngineConfigurator); writer.writeByteArray(sentMessage); Future writeFuture = writer.flush(); reader = null; writer.close(); writer = null; writer.close();
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }