SmtpServer
SmtpServer copied to clipboard
Server going down on SSL errors: Wider exception catching in ListenAsync
Hi, With IsSecure enabled, if a client sends crap to the server it simply goes down with Exception 'The handshake failed due to an unexpected packet format.' In ListenAsync only the OperationCanceledException is currently catched, i propose to catch a wider range to prevent the server from going completely down on errors. I'm running right now with all exceptions catched, but maybe a subset only would be necessary.
What do you think ?
Hi,
When you say that the client sends crap, are you saying that the client doesn't complete the SSL handshake but starts sending commands instead?
Hi, yes whe the client send something/anything which is not the expected TLS handshake. For example a simple curl to the server will put it down due to invalid handshake.
Hi @nopap ,
I've just pushed a fix for this so it now also catches the IOException that can be thrown here and then also ensures that the original Pipe is disposed.
Thanks, Cain.