本文整理了Java中javax.net.ssl.SSLEngine.isOutboundDone()
方法的一些代码示例,展示了SSLEngine.isOutboundDone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLEngine.isOutboundDone()
方法的具体详情如下:
包路径:javax.net.ssl.SSLEngine
类名称:SSLEngine
方法名:isOutboundDone
[英]Returns whether no more outbound data will be produced by this engine.
[中]返回此引擎是否不再生成出站数据。
代码示例来源:origin: redisson/redisson
@Override
public boolean isOutboundDone() {
return engine.isOutboundDone();
}
代码示例来源:origin: apache/ignite
/**
* @return {@code True} if outbound data stream has closed, i.e. SSL engine encoded
* <tt>close_notify</tt> message.
*/
boolean isOutboundDone() {
return sslEngine.isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isOutboundDone() {
return engine.isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isOutboundDone() {
return delegate.isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isOutboundDone() {
return delegate.isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
public boolean isOutboundDone() {
return delegate.isOutboundDone();
}
代码示例来源:origin: io.netty/netty
@Override
public boolean isOutboundDone() {
return engine.isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
public boolean isOutboundDone() {
return currentRef.get().isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
public boolean isOutboundDone() {
return currentRef.get().isOutboundDone();
}
代码示例来源:origin: wildfly/wildfly
public boolean isOutboundDone() {
return currentRef.get().isOutboundDone();
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns whether unwrap(ByteBuffer, ByteBuffer) will accept any more inbound data messages and
* whether wrap(ByteBuffer, ByteBuffer) will produce any more outbound data messages.
*
* @return true if the TLSHandler will not consume anymore network data and will not produce any
* anymore network data.
*/
public boolean isEngineClosed() {
return (tlsEngine.isOutboundDone() && tlsEngine.isInboundDone());
}
代码示例来源:origin: rapidoid/rapidoid
public boolean isClosed() {
return (engine.isOutboundDone() && engine.isInboundDone());
}
代码示例来源:origin: apache/ignite
/**
* Writes close_notify message to the network output buffer.
*
* @throws SSLException If wrap failed or SSL engine does not get closed
* after wrap.
* @return {@code True} if <tt>close_notify</tt> message was encoded, {@code false} if outbound
* stream was already closed.
*/
boolean closeOutbound() throws SSLException {
assert isHeldByCurrentThread();
if (!sslEngine.isOutboundDone()) {
sslEngine.closeOutbound();
outNetBuf.clear();
SSLEngineResult res = sslEngine.wrap(handshakeBuf, outNetBuf);
if (res.getStatus() != CLOSED)
throw new SSLException("Incorrect SSL engine status after closeOutbound call [status=" +
res.getStatus() + ", handshakeStatus=" + res.getHandshakeStatus() + ", ses=" + ses + ']');
outNetBuf.flip();
return true;
}
return false;
}
代码示例来源:origin: apache/geode
if (!engine.isOutboundDone()) {
ByteBuffer empty = ByteBuffer.wrap(new byte[0]);
engine.closeOutbound();
代码示例来源:origin: apache/geode
@Test
public void closeWhenSocketWriteError() throws Exception {
SocketChannel mockChannel = mock(SocketChannel.class);
Socket mockSocket = mock(Socket.class);
when(mockChannel.socket()).thenReturn(mockSocket);
when(mockSocket.isClosed()).thenReturn(true);
when(mockEngine.isOutboundDone()).thenReturn(Boolean.FALSE);
when(mockEngine.wrap(any(ByteBuffer.class), any(ByteBuffer.class))).thenAnswer((x) -> {
// give the NioSslEngine something to write on its socket channel, simulating a TLS close
// message
nioSslEngine.myNetData.put("Goodbye cruel world".getBytes());
return new SSLEngineResult(CLOSED, FINISHED, 0, 0);
});
when(mockChannel.write(any(ByteBuffer.class))).thenThrow(new ClosedChannelException());
nioSslEngine.close(mockChannel);
verify(mockChannel, times(1)).write(any(ByteBuffer.class));
}
代码示例来源:origin: apache/geode
@Test
public void closeWhenUnwrapError() throws Exception {
SocketChannel mockChannel = mock(SocketChannel.class);
Socket mockSocket = mock(Socket.class);
when(mockChannel.socket()).thenReturn(mockSocket);
when(mockSocket.isClosed()).thenReturn(true);
when(mockEngine.isOutboundDone()).thenReturn(Boolean.FALSE);
when(mockEngine.wrap(any(ByteBuffer.class), any(ByteBuffer.class))).thenReturn(
new SSLEngineResult(BUFFER_OVERFLOW, FINISHED, 0, 0));
assertThatThrownBy(() -> nioSslEngine.close(mockChannel)).isInstanceOf(GemFireIOException.class)
.hasMessageContaining("exception closing SSL session")
.hasCauseInstanceOf(SSLException.class);
}
代码示例来源:origin: apache/geode
@Test
public void close() throws Exception {
SocketChannel mockChannel = mock(SocketChannel.class);
Socket mockSocket = mock(Socket.class);
when(mockChannel.socket()).thenReturn(mockSocket);
when(mockSocket.isClosed()).thenReturn(false);
when(mockEngine.isOutboundDone()).thenReturn(Boolean.FALSE);
when(mockEngine.wrap(any(ByteBuffer.class), any(ByteBuffer.class))).thenReturn(
new SSLEngineResult(CLOSED, FINISHED, 0, 0));
nioSslEngine.close(mockChannel);
assertThatThrownBy(() -> nioSslEngine.checkClosed()).isInstanceOf(IllegalStateException.class);
nioSslEngine.close(mockChannel);
}
代码示例来源:origin: jersey/jersey
&& !sslEngine.isOutboundDone()) {
state = State.REHANDSHAKING;
return doHandshakeStep(networkData);
代码示例来源:origin: wildfly/wildfly
/**
* Attempt to finish wrapping close handshake bytes.
*
* @return {@code true} only if all bytes concerning close handshake messages have been wrapped.
* @throws IOException if an unexpected IO exception occurs
*/
private boolean wrapCloseMessage() throws IOException {
assert ! Thread.holdsLock(getUnwrapLock());
assert Thread.holdsLock(getWrapLock());
if (sinkConduit.isWriteShutdown()) {
return true;
}
final ByteBuffer buffer = sendBuffer.getResource();
if (!engine.isOutboundDone() || !engine.isInboundDone()) {
SSLEngineResult result;
do {
if (!handleWrapResult(result = engineWrap(Buffers.EMPTY_BYTE_BUFFER, buffer), true)) {
return false;
}
} while (handleHandshake(result, true) && (result.getHandshakeStatus() != HandshakeStatus.NEED_UNWRAP || !engine.isOutboundDone()));
handleWrapResult(result = engineWrap(Buffers.EMPTY_BYTE_BUFFER, buffer), true);
if (!engine.isOutboundDone() || (result.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING &&
result.getHandshakeStatus() != HandshakeStatus.NEED_UNWRAP)) {
return false;
}
}
return true;
}
代码示例来源:origin: wildfly/wildfly
oldState = stateUpdater.get(this);
if (allAreSet(oldState, WRITE_COMPLETE)) {
if (engine.isOutboundDone()) {
connection.writeClosed();
if (engine.isOutboundDone()) {
connection.writeClosed();
oldState = stateUpdater.get(this);
if (allAreSet(oldState, WRITE_COMPLETE)) {
if (engine.isOutboundDone()) {
connection.writeClosed();
closeEngine();
if (engine.isOutboundDone()) {
connection.writeClosed();
内容来源于网络,如有侵权,请联系作者删除!