IWebSocketInformation2.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 = iWebSocketInformation2.serverCertificate;
Public ReadOnly Property ServerCertificate As Certificate

Property Value

The server certificate.

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 appropriate MessageWebSocket.ServerCustomValidationRequested or StreamWebSocket.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