Skip to content

Commit

Permalink
Added EAGAIN handling in SslSocket::doRead/doWrite() methods
Browse files Browse the repository at this point in the history
Fixes OSSM-6809

Signed-off-by: Ted Poole <tpoole@redhat.com>
  • Loading branch information
tedjpoole committed Jul 25, 2024
1 parent edb046c commit 0da39cb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions source/extensions/transport_sockets/tls/ssl_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ Network::IoResult SslSocket::doRead(Buffer::Instance& read_buffer) {
break;
}
FALLTHRU;
case SSL_ERROR_SSL:
// If EAGAIN treat it as if it's SSL_ERROR_WANT_READ
if (errno == EAGAIN) {
ENVOY_CONN_LOG(debug, "errno:{}:{}", callbacks_->connection(), errno,
Envoy::errorDetails(errno));
break;
}
// fall through for other errors
case SSL_ERROR_WANT_WRITE:
// Renegotiation has started. We don't handle renegotiation so just fall through.
default:
Expand Down Expand Up @@ -327,6 +335,15 @@ Network::IoResult SslSocket::doWrite(Buffer::Instance& write_buffer, bool end_st
case SSL_ERROR_WANT_WRITE:
bytes_to_retry_ = bytes_to_write;
break;
case SSL_ERROR_SSL:
// If EAGAIN treat it as if it's SSL_ERROR_WANT_WRITE
if (errno == EAGAIN) {
ENVOY_CONN_LOG(debug, "errno:{}:{}", callbacks_->connection(), errno,
Envoy::errorDetails(errno));
bytes_to_retry_ = bytes_to_write;
break;
}
// fall through for other errors
case SSL_ERROR_WANT_READ:
// Renegotiation has started. We don't handle renegotiation so just fall through.
default:
Expand Down

0 comments on commit 0da39cb

Please sign in to comment.