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

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

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

SSLEngine.closeInbound介绍

[英]Notifies this engine instance that no more inbound network data will be sent to this engine.
[中]通知此引擎实例不再向此引擎发送入站网络数据。

代码示例

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

  1. @Override
  2. public void closeInbound() throws SSLException {
  3. engine.closeInbound();
  4. }

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

  1. @Override
  2. public void closeInbound() throws SSLException {
  3. engine.closeInbound();
  4. }

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

  1. @Override
  2. public void closeInbound() throws SSLException {
  3. delegate.closeInbound();
  4. }

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

  1. @Override
  2. public void closeInbound() throws SSLException {
  3. delegate.closeInbound();
  4. }

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

  1. public void closeInbound() throws SSLException {
  2. delegate.closeInbound();
  3. }

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

  1. public void closeInbound() throws SSLException {
  2. currentRef.get().closeInbound();
  3. }

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

  1. public void closeInbound() throws SSLException {
  2. currentRef.get().closeInbound();
  3. }

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

  1. public void closeInbound() throws SSLException {
  2. currentRef.get().closeInbound();
  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: TooTallNate/Java-WebSocket

  1. /**
  2. * In addition to orderly shutdowns, an unorderly shutdown may occur, when the transport link (socket channel)
  3. * is severed before close messages are exchanged. This may happen by getting an -1 or {@link IOException}
  4. * when trying to read from the socket channel, or an {@link IOException} when trying to write to it.
  5. * In both cases {@link SSLEngine#closeInbound()} should be called and then try to follow the standard procedure.
  6. *
  7. * @throws IOException if an I/O error occurs to the socket channel.
  8. */
  9. private void handleEndOfStream() throws IOException {
  10. try {
  11. engine.closeInbound();
  12. } catch ( Exception e ) {
  13. log.error( "This engine was forced to close inbound, without having received the proper SSL/TLS close notification message from the peer, due to end of stream." );
  14. }
  15. closeConnection();
  16. }

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

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

代码示例来源: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: rapidoid/rapidoid

  1. public synchronized void closeInbound() {
  2. try {
  3. engine.closeInbound();
  4. } catch (SSLException e) {
  5. Log.warn("SSL error while closing connection", "message", Msc.errorMsg(e));
  6. }
  7. }

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

  1. /**
  2. * Shuts down the handler.
  3. */
  4. void shutdown() {
  5. try {
  6. sslEngine.closeInbound();
  7. }
  8. catch (SSLException e) {
  9. // According to javadoc, the only case when exception is thrown is when no close_notify
  10. // message was received before TCP connection get closed.
  11. if (log.isDebugEnabled())
  12. log.debug("Unable to correctly close inbound data stream (will ignore) [msg=" + e.getMessage() +
  13. ", ses=" + ses + ']');
  14. }
  15. }

代码示例来源: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.closeInbound();
  2. } catch (SSLException e) {
  3. if (logger.isDebugEnabled()) {

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

  1. engine.closeInbound();
  2. } catch (SSLException e) {
  3. if (logger.isDebugEnabled()) {

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

  1. engine.closeInbound();

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

  1. void notifyReadClosed() {
  2. if(anyAreSet(state, FLAG_READ_CLOSED)) {
  3. return;
  4. }
  5. boolean runListener = isReadResumed() && anyAreSet(state, FLAG_CLOSED);
  6. connection.readClosed();
  7. try {
  8. engine.closeInbound();
  9. } catch (SSLException e) {
  10. UndertowLogger.REQUEST_IO_LOGGER.trace("Exception closing read side of SSL channel", e);
  11. if(allAreClear(state, FLAG_WRITE_CLOSED) && isWriteResumed()) {
  12. runWriteListener();
  13. }
  14. }
  15. state |= FLAG_READ_CLOSED | FLAG_ENGINE_INBOUND_SHUTDOWN | FLAG_READ_SHUTDOWN;
  16. if(anyAreSet(state, FLAG_WRITE_CLOSED)) {
  17. closed();
  18. }
  19. if(anyAreSet(state, FLAG_WRITE_REQUIRES_READ)) {
  20. notifyWriteClosed();
  21. }
  22. if(runListener) {
  23. runReadListener(false);
  24. }
  25. }

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

  1. engine.closeInbound();
  2. } catch (SSLException e) {
  3. UndertowLogger.REQUEST_LOGGER.ioException(e);

相关文章