MSDN Library

Documentation for .NET Framework

System.Net.Security.ValidateNamesFlags Enumeration

Specifies the validation behavior for certificate names.

[FlagsAttribute] public enum ValidateNamesFlags

Members

Default

Specifies the default validation behavior. This is equivalent to using no flags.

(0)

AllowAnyName

Specifies that any name is acceptable. This is useful for testing scenarios.

(1)

AllowAnonymousNames

Specifies that anonymous names are acceptable. This flag is rarely used in production environments.

(2)

AllowMultiplePublicCertificates

Specifies that multiple public certificates are allowed. This flag is typically used when dealing with systems that may have multiple certificates installed.

(4)

AllowWildcardCertificates

Specifies that wildcard certificates are allowed. This means certificates with hostnames like *.example.com will be considered valid.

(8)

UseDefaultCredentials

Specifies that default credentials should be used for authentication. This flag is often paired with other flags to control specific aspects of the validation process.

(16)

Remarks

The ValidateNamesFlags enumeration is used to control how the System.Net.Security.SslStream class validates the host name against the certificate presented by the server.

When establishing a secure connection using SslStream, the client typically validates the server's certificate to ensure it is connecting to the correct server and that the connection is secure.

By default, SslStream performs a strict validation of the host name. If the host name in the certificate does not match the host name of the server, the validation will fail.

The flags in this enumeration provide flexibility in controlling this validation process, allowing for scenarios such as testing, development, or situations where strict adherence to certificate host names is not feasible or desired.

See Also