ServicePointManager.ServerCertificateValidationCallback Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the callback to validate a server certificate.

Namespace:   System.Net
Assembly:  System (in System.dll)

static member ServerCertificateValidationCallback : RemoteCertificateValidationCallback with get, set

An application can set the ServerCertificateValidationCallback property to a method to use for custom validation by the client of the server certificate. When doing custom validation, the sender parameter passed to the RemoteCertificateValidationCallback can be a host string name or an object derived from WebRequest (HttpWebRequest, for example) depending on the CertificatePolicy property.

When custom validation is not used, the certificate name is compared with host name used to create the request. For example, if Create(String) was passed a parameter of "https://www.contoso.com/default.hmtl", the default behavior is for the client to check the certificate against www.contoso.com.

SecurityPermission

to set the ServerCertificateValidationCallback property. Associated enumeration: SecurityPermissionFlag.Infrastructure.

.NET Framework
Available since 2.0
Return to top
Show: