

If a Wait() is performed on async code on shutdown a ReadAsync it freezes the editor and I have encountered asynchronous tasks staying open and logging after stopping execution. An exception is thrown, whether it be "A call to SSPI failed, see inner exception.", or the other mystery exception, "Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.", even though data has been received before that shutdown occurred and the shutdown was graceful.Īll of the above happens on SslStream built either from a TcpClient or from a NetworkStream attached to a Socket. However the above issue continues against OpenSSL if I just open SslStream and shutdown the remote end of the connection. I've also determined that ShutdownAsync() does not shut down the SSL stream cleanly, which makes testing confusing, and I have tested this against OpenSSL with Unity acting as client and server.
