X509ServiceCertificateAuthentication.CertificateValidationMode Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the certificate validation mode.
public:
property System::ServiceModel::Security::X509CertificateValidationMode CertificateValidationMode { System::ServiceModel::Security::X509CertificateValidationMode get(); void set(System::ServiceModel::Security::X509CertificateValidationMode value); };
public System.ServiceModel.Security.X509CertificateValidationMode CertificateValidationMode { get; set; }
member this.CertificateValidationMode : System.ServiceModel.Security.X509CertificateValidationMode with get, set
Public Property CertificateValidationMode As X509CertificateValidationMode
Property Value
A value from the enumeration in X509CertificateValidationMode.
Examples
The following code shows how to set this property.
ClientCredentials creds = new ClientCredentials();
// Configure peer trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.PeerTrust;
// Configure chain trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.ChainTrust;
// Configure custom certificate validation.
creds.ServiceCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.Custom;
creds.ServiceCertificate.Authentication.CustomCertificateValidator =
new MyCertificateValidator();
Dim creds As New ClientCredentials()
' Configure peer trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.PeerTrust
' Configure chain trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.ChainTrust
' Configure custom certificate validation.
creds.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.Custom
creds.ServiceCertificate.Authentication.CustomCertificateValidator = New MyCertificateValidator()
The property can also be set in a configuration file.
Remarks
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.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET