ServerCertificateSelectionCallback 代理人

定義

選取伺服器安全套接字層 (SSL) 憑證。

C#
public delegate System.Security.Cryptography.X509Certificates.X509Certificate ServerCertificateSelectionCallback(object sender, string? hostName);
C#
public delegate System.Security.Cryptography.X509Certificates.X509Certificate ServerCertificateSelectionCallback(object sender, string hostName);

參數

sender
Object

SslStream 物件。

hostName
String

用戶端所要求的主機名稱。 如果用戶端不使用 host_name TLS 延伸模組,則 hostName 為空字串。

傳回值

X509Certificate,用於建立 SSL 連線。

備註

伺服器會使用此委派來選取伺服器連接證書。

類別會 SslStream 使用此委派。 類別 SslStream 可用來協助保護客戶端與伺服器之間交換的資訊。

擴充方法

GetMethodInfo(Delegate)

取得表示特定委派所代表之方法的物件。

適用於

產品 版本
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1