Skip to content

Commit

Permalink
Use WithTrustChain from latest MQTTNet (#86)
Browse files Browse the repository at this point in the history
* upd to 4.3.2

* use WithTrustChain

---------

Co-authored-by: rido-min <rido-min@ghnouser.com>
  • Loading branch information
rido-min and rido-min authored Dec 5, 2023
1 parent c561161 commit d82044c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public static MqttClientOptionsBuilder WithTlsSettings(this MqttClientOptionsBui

if (!string.IsNullOrEmpty(cs.CaFile))
{
tlsParams.WithCertificateValidationHandler(ea => X509ChainValidator.ValidateChain(ea, cs.CaFile!));
X509Certificate2Collection chain = new();
chain.ImportFromPemFile(cs.CaFile);
tlsParams.WithTrustChain(chain);
tlsParams.WithRevocationMode(X509RevocationMode.NoCheck);
}

if (!string.IsNullOrEmpty(cs.CertFile) && !string.IsNullOrEmpty(cs.KeyFile))
Expand Down
51 changes: 0 additions & 51 deletions mqttclients/dotnet/MQTTnet.Client.Extensions/X509ChainValidator.cs

This file was deleted.

0 comments on commit d82044c

Please sign in to comment.