This documentation is archived and is not being maintained.

X509ServiceCertificateAuthentication.CertificateValidationMode Property

Gets the certificate validation mode.

Namespace: System.ServiceModel.Security
Assembly: System.ServiceModel (in system.servicemodel.dll)

public X509CertificateValidationMode CertificateValidationMode { get; set; }
/** @property */
public X509CertificateValidationMode get_CertificateValidationMode ()

/** @property */
public void set_CertificateValidationMode (X509CertificateValidationMode value)

public function get CertificateValidationMode () : X509CertificateValidationMode

public function set CertificateValidationMode (value : X509CertificateValidationMode)

Not applicable.

Property Value

A value from the enumeration in X509CertificateValidationMode.

This enumeration captures the options for determining the validity of the service certificate obtained using SSL/TLS negotiation. For a list of the enumeration members, see X509CertificateValidationMode.

The following code shows how to set this property.

ClientCredentials creds = new ClientCredentials();
// Configure peer trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode =

// Configure chain trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode =

// Configure custom certificate validation.
creds.ServiceCertificate.Authentication.CertificateValidationMode =
creds.ServiceCertificate.Authentication.CustomCertificateValidator =
    new MyCertificateValidator();

The property can also be set in a configuration file.

        <behavior name="behave">
              <authentication certificateValidationMode='ChainTrust' />

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0