SslCertificateTrust.CreateForX509Collection Metod

Definition

Skapar en ny SslCertificateTrust.

public static System.Net.Security.SslCertificateTrust CreateForX509Collection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection trustList, bool sendTrustInHandshake = false);
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static System.Net.Security.SslCertificateTrust CreateForX509Collection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection trustList, bool sendTrustInHandshake = false);
static member CreateForX509Collection : System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool -> System.Net.Security.SslCertificateTrust
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
static member CreateForX509Collection : System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool -> System.Net.Security.SslCertificateTrust
Public Shared Function CreateForX509Collection (trustList As X509Certificate2Collection, Optional sendTrustInHandshake As Boolean = false) As SslCertificateTrust

Parametrar

trustList
X509Certificate2Collection

Samlingen som innehåller de betrodda certifikaten.

sendTrustInHandshake
Boolean

true för servern att skicka en lista över betrodda certifikatutfärdare under TLS-handskakningen. false att inte skicka listan.

Returer

Representerar en förtroendeprincip.

Attribut

Undantag

sendTrustInHandshake är true och den aktuella plattformen stöder inte att skicka listan över betrodda utfärdare i handskakning.

Kommentarer

sendTrustInHandshake Om argumentet är truekan klienten använda listan över betrodda certifikatutfärdare från servern för att välja ett lämpligt klientcertifikat. Det går inte att skicka listan över betrodda utfärdare för SslCertificateTrust-instanser som skapats med hjälp av SslCertificaetTrust.CreateForX509Collection i .NET 6.

Sedan .NET 7 stöds listan över sändande betrodda utfärdare på Linux- och OSX-plattformar.

Varning

Listan över betrodda certifikatutfärdare ökar storleken på handskakningsmeddelandet. Det kan också ses som en informationsläcka om systemets konfiguration. Därför rekommenderar vi att du anger sendTrustInHandshake till false.

Gäller för