void beginHandshake() throws SSLException { sslEngine.beginHandshake(); }
@Override public void beginHandshake() throws SSLException { engine.beginHandshake(); }
/** * Begins handshake. * * @throws IOException if an I/O error occurs */ public void beginHandshake() throws IOException { engine.beginHandshake(); }
public void startHandshake() throws SSLException { state |= FLAG_READ_REQUIRES_WRITE; engine.beginHandshake(); }
@Override public void beginHandshake() throws SSLException { engine.beginHandshake(); }
@Override public void beginHandshake() throws SSLException { delegate.beginHandshake(); }
@Override public void beginHandshake() throws SSLException { delegate.beginHandshake(); }
public void beginHandshake() throws SSLException { delegate.beginHandshake(); }
@Override public void beginHandshake() throws SSLException { engine.beginHandshake(); }
public void beginHandshake() throws SSLException { currentRef.get().beginHandshake(); }
public void beginHandshake() throws SSLException { currentRef.get().beginHandshake(); }
public void beginHandshake() throws SSLException { currentRef.get().beginHandshake(); }
/** * Only for test. */ void rehandshake() { try { sslEngine.beginHandshake(); } catch (SSLException e) { handleSslError(e); } }
protected void startHandshake() throws IOException { if (state != State.NOT_INITALIZED) throw new IllegalStateException("startHandshake() can only be called once, state " + state); this.netReadBuffer = ByteBuffer.allocate(netReadBufferSize()); this.netWriteBuffer = ByteBuffer.allocate(netWriteBufferSize()); this.appReadBuffer = ByteBuffer.allocate(applicationBufferSize()); //clear & set netRead & netWrite buffers netWriteBuffer.position(0); netWriteBuffer.limit(0); netReadBuffer.position(0); netReadBuffer.limit(0); state = State.HANDSHAKE; //initiate handshake sslEngine.beginHandshake(); handshakeStatus = sslEngine.getHandshakeStatus(); }
public SSLSocketChannel( SocketChannel inputSocketChannel, SSLEngine inputEngine, ExecutorService inputExecutor, SelectionKey key ) throws IOException { if( inputSocketChannel == null || inputEngine == null || executor == inputExecutor ) throw new IllegalArgumentException( "parameter must not be null" ); this.socketChannel = inputSocketChannel; this.engine = inputEngine; this.executor = inputExecutor; myNetData = ByteBuffer.allocate( engine.getSession().getPacketBufferSize() ); peerNetData = ByteBuffer.allocate( engine.getSession().getPacketBufferSize() ); this.engine.beginHandshake(); if( doHandshake() ) { if( key != null ) { key.interestOps( key.interestOps() | SelectionKey.OP_WRITE ); } } else { try { socketChannel.close(); } catch ( IOException e ) { log.error("Exception during the closing of the channel", e); } } }
void beginHandshake() throws IOException { final int state = this.state; if (anyAreSet(state, READ_FLAG_EOF | WRITE_FLAG_SHUTDOWN)) { throw new ClosedChannelException(); } if (allAreClear(state, FLAG_TLS)) { this.state = state | FLAG_TLS; } engine.beginHandshake(); }
@Override void startSsl() { try { state = State.HANDSHAKING; sslEngine.beginHandshake(); doHandshakeStep(emptyBuffer); } catch (SSLException e) { handleSslError(e); } }
private void doHandshake(final boolean force) throws IOException, EofException { if (!force && negotiated) { return; } if (invalid || shutdownSent) { throw new ClosedChannelException(); } initLock.lock(); try { if (force || !negotiated) { engine.beginHandshake(); LOGGER.trace("Called engine.beginHandshake()"); handshake(Optional.<ByteBufferSet>empty(), Optional.<HandshakeStatus>empty()); // call client code try { initSessionCallback.accept(engine.getSession()); } catch (Exception e) { LOGGER.trace("client code threw exception in session initialization callback", e); throw new TlsChannelCallbackException("session initialization callback failed", e); } negotiated = true; } } finally { initLock.unlock(); } }
/** * Performs TLS (re)negotiation. */ private void handshake() { if (engine.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING) { // Not all SSLEngine implementations support calling beginHandshake multiple times while a handshake // is in progress. See https://github.com/netty/netty/issues/4718. return; } else { if (handshakePromise.isDone()) { // If the handshake is done already lets just return directly as there is no need to trigger it again. // This can happen if the handshake(...) was triggered before we called channelActive(...) by a // flush() that was triggered by a ChannelFutureListener that was added to the ChannelFuture returned // from the connect(...) method. In this case we will see the flush() happen before we had a chance to // call fireChannelActive() on the pipeline. return; } } // Begin handshake. final ChannelHandlerContext ctx = this.ctx; try { engine.beginHandshake(); wrapNonAppData(ctx, false); } catch (Throwable e) { setHandshakeFailure(ctx, e); } finally { forceFlush(ctx); } }
engine.beginHandshake(); wrapNonAppData(ctx, false); } catch (Throwable e) {