Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.IO.IOException: Authentication failed because the remote party has closed the transport stream #174

Open
PinnacleCoders opened this issue Feb 27, 2022 · 0 comments

Comments

@PinnacleCoders
Copy link

Hello,
Of late I am getting above mentioned error intermittently. I thought this could be the TLS version mismatch issue so I tried

SmtpServerOptionsBuilder options = new SmtpServerOptionsBuilder();

            options.ServerName("Smtp Server")
            .MessageStore(new EmailHandler2())// Register EmailStore 
            .MailboxFilter(new GatewayFilter())
            .SupportedSslProtocols(SslProtocols.Tls |
                                              SslProtocols.Tls11 |
                                              SslProtocols.Tls12)

As you can see above, I added all the supported TLS versions but no success. Following is the detailed error:

System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at SmtpServer.IO.NetworkClient.UpgradeAsync(X509Certificate2 certificate, SslProtocols protocols, CancellationToken cancellationToken) in /src/SmtpServer/IO/NetworkClient.cs:line 132 at SmtpServer.Protocol.StartTlsCommand.ExecuteAsync(SmtpSessionContext context, CancellationToken cancellationToken) in /src/SmtpServer/Protocol/StartTlsCommand.cs:line 30 at SmtpServer.SmtpSession.ExecuteAsync(SmtpSessionContext context, CancellationToken cancellationToken) in /src/SmtpServer/SmtpSession.cs:line 96 at SmtpServer.SmtpSession.RunAsync(CancellationToken cancellationToken) in /src/SmtpServer/SmtpSession.cs:line 71 --- End of inner exception stack trace ---

@cosullivan Can you please suggest what may be going wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant