Browse Source

Fix memory leak when SSL is not working properly.

release/3.x.x
Christian Kratky 5 years ago
parent
commit
975eb60e90
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      Source/MQTTnet/Implementations/MqttTcpChannel.cs

+ 2
- 2
Source/MQTTnet/Implementations/MqttTcpChannel.cs View File

@@ -84,9 +84,9 @@ namespace MQTTnet.Implementations
if (_options.TlsOptions.UseTls) if (_options.TlsOptions.UseTls)
{ {
var sslStream = new SslStream(networkStream, false, InternalUserCertificateValidationCallback); var sslStream = new SslStream(networkStream, false, InternalUserCertificateValidationCallback);
await sslStream.AuthenticateAsClientAsync(_options.Server, LoadCertificates(), _options.TlsOptions.SslProtocol, _options.TlsOptions.IgnoreCertificateRevocationErrors).ConfigureAwait(false);

_stream = sslStream; _stream = sslStream;

await sslStream.AuthenticateAsClientAsync(_options.Server, LoadCertificates(), _options.TlsOptions.SslProtocol, _options.TlsOptions.IgnoreCertificateRevocationErrors).ConfigureAwait(false);
} }
else else
{ {


Loading…
Cancel
Save