You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that SslSession does not always handle all the exceptions coming from async actions on SslStream. An example of internal exception stack trace: System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ?, in void AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) ?, in async ValueTask<int> SslStream.EnsureFullTlsFrameAsync<TIOAdapter>(CancellationToken cancellationToken, int estimatedSize) ?, in async ValueTask<int> SslStream.ReadAsyncInternal<TIOAdapter>(Memory<byte> buffer, CancellationToken cancellationToken) ?, in static ValueTaskSourceAsTask()+(object state) => { }
It seems that this unobserved exception appears when SslSession is disposed (or disconnected) from server side, while the receive task is still pending. My assumption is that disconnecting SslSession creates a race condition on IsHandshaked property, which is considered in ProcessReceive() before invoking SslStream.EndRead, which is necessary to catch any exception which may have happened in SslStream read task. This may also happen in during other phases, such as handshake or sending.
NetCoreServer version: 8.0.7
The text was updated successfully, but these errors were encountered:
It appears that SslSession does not always handle all the exceptions coming from async actions on SslStream. An example of internal exception stack trace:
System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ?, in void AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) ?, in async ValueTask<int> SslStream.EnsureFullTlsFrameAsync<TIOAdapter>(CancellationToken cancellationToken, int estimatedSize) ?, in async ValueTask<int> SslStream.ReadAsyncInternal<TIOAdapter>(Memory<byte> buffer, CancellationToken cancellationToken) ?, in static ValueTaskSourceAsTask()+(object state) => { }
It seems that this unobserved exception appears when
SslSession
is disposed (or disconnected) from server side, while the receive task is still pending. My assumption is that disconnecting SslSession creates a race condition onIsHandshaked
property, which is considered inProcessReceive()
before invokingSslStream.EndRead,
which is necessary to catch any exception which may have happened in SslStream read task. This may also happen in during other phases, such as handshake or sending.NetCoreServer version:
8.0.7
The text was updated successfully, but these errors were encountered: