javax.net.ssl.SSLEngine.closeOutbound()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中javax.net.ssl.SSLEngine.closeOutbound()方法的一些代码示例,展示了SSLEngine.closeOutbound()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLEngine.closeOutbound()方法的具体详情如下:
包路径:javax.net.ssl.SSLEngine
类名称:SSLEngine
方法名:closeOutbound

SSLEngine.closeOutbound介绍

[英]Notifies this engine instance that no more outbound application data will be sent to this engine.
[中]通知此引擎实例不再向此引擎发送出站应用程序数据。

代码示例

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public void closeOutbound() {
  3. engine.closeOutbound();
  4. }

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void closeOutbound() {
  3. engine.closeOutbound();
  4. }

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void closeOutbound() {
  3. delegate.closeOutbound();
  4. }

代码示例来源:origin: igniterealtime/Openfire

  1. /**
  2. * Signals that no more outbound application data will be sent on this TLSHandler.
  3. *
  4. * @throws SSLException
  5. */
  6. public void close() throws SSLException {
  7. // Indicate that application is done with engine
  8. tlsEngine.closeOutbound();
  9. }

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void closeOutbound() {
  3. delegate.closeOutbound();
  4. }

代码示例来源:origin: wildfly/wildfly

  1. public void closeOutbound() {
  2. delegate.closeOutbound();
  3. }

代码示例来源:origin: wildfly/wildfly

  1. public void closeOutbound() {
  2. currentRef.get().closeOutbound();
  3. }

代码示例来源:origin: wildfly/wildfly

  1. public void closeOutbound() {
  2. currentRef.get().closeOutbound();
  3. }

代码示例来源:origin: wildfly/wildfly

  1. public void closeOutbound() {
  2. currentRef.get().closeOutbound();
  3. }

代码示例来源:origin: apache/kafka

  1. void close() {
  2. sslEngine.closeOutbound();
  3. try {
  4. sslEngine.closeInbound();
  5. } catch (Exception e) {
  6. // ignore
  7. }
  8. }
  9. }

代码示例来源:origin: apache/activemq

  1. /**
  2. * close this stream
  3. *
  4. * @throws IOException
  5. */
  6. @Override
  7. public void close() throws IOException {
  8. super.close();
  9. if (engine != null) {
  10. engine.closeOutbound();
  11. }
  12. closed = true;
  13. }

代码示例来源:origin: TooTallNate/Java-WebSocket

  1. public void close() throws IOException {
  2. sslEngine.closeOutbound();
  3. sslEngine.getSession().invalidate();
  4. if( socketChannel.isOpen() )
  5. socketChannel.write( wrap( emptybuffer ) );// FIXME what if not all bytes can be written
  6. socketChannel.close();
  7. }

代码示例来源:origin: TooTallNate/Java-WebSocket

  1. /**
  2. * This method should be called when this peer wants to explicitly close the connection
  3. * or when a close message has arrived from the other peer, in order to provide an orderly shutdown.
  4. * <p/>
  5. * It first calls {@link SSLEngine#closeOutbound()} which prepares this peer to send its own close message and
  6. * sets {@link SSLEngine} to the <code>NEED_WRAP</code> state. Then, it delegates the exchange of close messages
  7. * to the handshake method and finally, it closes socket channel.
  8. *
  9. * @throws IOException if an I/O error occurs to the socket channel.
  10. */
  11. private void closeConnection() throws IOException {
  12. engine.closeOutbound();
  13. try {
  14. doHandshake();
  15. } catch ( IOException e ) {
  16. //Just ignore this exception since we are closing the connection already
  17. }
  18. socketChannel.close();
  19. }

代码示例来源:origin: io.netty/netty

  1. @Override
  2. public void closeOutbound() {
  3. NextProtoNego.remove(engine);
  4. engine.closeOutbound();
  5. }

代码示例来源:origin: apache/kafka

  1. if (state == State.CLOSING) return;
  2. state = State.CLOSING;
  3. sslEngine.closeOutbound();
  4. try {
  5. if (prevState != State.NOT_INITALIZED && isConnected()) {

代码示例来源:origin: redisson/redisson

  1. private void closeOutbound0(ChannelPromise promise) {
  2. outboundClosed = true;
  3. engine.closeOutbound();
  4. try {
  5. flush(ctx, promise);
  6. } catch (Exception e) {
  7. if (!promise.tryFailure(e)) {
  8. logger.warn("{} flush() raised a masked exception.", ctx.channel(), e);
  9. }
  10. }
  11. }

代码示例来源:origin: apache/kafka

  1. /**
  2. * SSL exceptions are propagated as authentication failures so that clients can avoid
  3. * retries and report the failure. If `flush` is true, exceptions are propagated after
  4. * any pending outgoing bytes are flushed to ensure that the peer is notified of the failure.
  5. */
  6. private void handshakeFailure(SSLException sslException, boolean flush) throws IOException {
  7. //Release all resources such as internal buffers that SSLEngine is managing
  8. sslEngine.closeOutbound();
  9. try {
  10. sslEngine.closeInbound();
  11. } catch (SSLException e) {
  12. log.debug("SSLEngine.closeInBound() raised an exception.", e);
  13. }
  14. state = State.HANDSHAKE_FAILED;
  15. handshakeException = new SslAuthenticationException("SSL handshake failed", sslException);
  16. // Attempt to flush any outgoing bytes. If flush doesn't complete, delay exception handling until outgoing bytes
  17. // are flushed. If write fails because remote end has closed the channel, log the I/O exception and continue to
  18. // handle the handshake failure as an authentication exception.
  19. try {
  20. if (!flush || flush(netWriteBuffer))
  21. throw handshakeException;
  22. } catch (IOException e) {
  23. log.debug("Failed to flush all bytes before closing channel", e);
  24. throw handshakeException;
  25. }
  26. }

代码示例来源:origin: wildfly/wildfly

  1. private void closeOutbound0(ChannelPromise promise) {
  2. outboundClosed = true;
  3. engine.closeOutbound();
  4. try {
  5. flush(ctx, promise);
  6. } catch (Exception e) {
  7. if (!promise.tryFailure(e)) {
  8. logger.warn("{} flush() raised a masked exception.", ctx.channel(), e);
  9. }
  10. }
  11. }

代码示例来源:origin: io.netty/netty

  1. private void closeEngine() {
  2. engine.closeOutbound();
  3. if (sentCloseNotify == 0 && handshaken) {
  4. try {
  5. engine.closeInbound();
  6. } catch (SSLException ex) {
  7. if (logger.isDebugEnabled()) {
  8. logger.debug("Failed to clean up SSLEngine.", ex);
  9. }
  10. }
  11. }
  12. }

代码示例来源:origin: redisson/redisson

  1. engine.closeOutbound();

相关文章