Share via


MessageWebSocketInformation.ServerCertificate Property

Definition

Gets the certificate provided by the server when a secure WebSocket connection has been established.

public:
 property Certificate ^ ServerCertificate { Certificate ^ get(); };
Certificate ServerCertificate();
public Certificate ServerCertificate { get; }
var certificate = messageWebSocketInformation.serverCertificate;
Public ReadOnly Property ServerCertificate As Certificate

Property Value

The server certificate.

Implements

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Remarks

By the time the server certificate is available through this property, the SSL connection has already been established.

If you wish to inspect the server certificate during the connection process in order to perform custom validation, you should register a handler for the MessageWebSocket.ServerCustomValidationRequested event, and perform your custom server validation in that handler.

If you merely wish to ignore certain classes of error when the server certificate is validated (for example, you are using a self-signed certificate and wish to ignore the validation error caused by this condition) you can use the IgnorableServerCertificateErrors property to ignore the relevant classes of errors.

Applies to