dotnet/WatsonTcp

_SslCertificate leaks 2Kb file

bendablegears opened this issue · 3 comments

When using X509Certificate2's constructor it creates a 2kb file in C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys. This file is not cleaned up unless the X509Certificate2 object is Reset() or Dispose()ed.

In WatsonTcpClient and WatsonTcpServer's Dispose method,

if (_SslCertificate != null)
{
	_SslCertificate.Dispose();
}

Should be added.

A PR has been created

#217

PR has been merged, thanks!

Hi @bendablegears thanks for doing this! I'll get a new version pushed soon. The reason for the delay is I'm moving the package off of Newtonsoft.Json, and encountering some issues in doing so. But I will get it going, hopefully soon. Cheers, Joel