Skip to content

Commit

Permalink
Fix .NET Framework builds
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed May 1, 2024
1 parent bbd83c0 commit 5e51539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public MqttClientCertificateValidationEventArgs(X509Certificate certificate, X50
{
Certificate = certificate;
Chain = chain;
ClientOptions = clientOptions;
SslPolicyErrors = sslPolicyErrors;
ClientOptions = clientOptions ?? throw new ArgumentNullException(nameof(clientOptions));
}

public X509Certificate Certificate { get; }
Expand Down
8 changes: 2 additions & 6 deletions Source/MQTTnet/Implementations/MqttWebSocketChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,9 @@ void SetupClientWebSocket(ClientWebSocket clientWebSocket)
#elif NET452 || NET461 || NET48
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) =>
{
var context = new MqttClientCertificateValidationEventArgs
var context = new MqttClientCertificateValidationEventArgs(certificate, chain, sslPolicyErrors, _options)
{
Sender = sender,
Certificate = certificate,
Chain = chain,
SslPolicyErrors = sslPolicyErrors,
ClientOptions = _options
Sender = sender
};
return certificateValidationHandler(context);
Expand Down

0 comments on commit 5e51539

Please sign in to comment.