IWebSocketControl2
IWebSocketControl2
IWebSocketControl2
IWebSocketControl2
Interface
Definition
Provides socket control data on an IWebSocket object. This interface extends the IWebSocketControl interface with an additional property.
public : interface IWebSocketControl2public interface IWebSocketControl2Public Interface IWebSocketControl2// You can use this interface in JavaScript.
- Inheritance
-
IWebSocketControl2IWebSocketControl2IWebSocketControl2IWebSocketControl2
- Attributes
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
Inherited Members
Inherited properties
Properties
IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors
Gets a list of ignorable server certificate errors. Get this list and add ChainValidationResult values for server certificate errors that you wish to ignore during the secure WebSocket (wss:// protocol) server certificate validation process.
public : IVector<ChainValidationResult> IgnorableServerCertificateErrors { get; }public IList<ChainValidationResult> IgnorableServerCertificateErrors { get; }Public ReadOnly Property IgnorableServerCertificateErrors As IList<ChainValidationResult>// You can use this property in JavaScript.
- Value
- IVector<ChainValidationResult> IList<ChainValidationResult> IList<ChainValidationResult> IList<ChainValidationResult>
A list of ChainValidationResult values indicating the server certificate errors to ignore when validating server certificates. By default, the list is empty, and all errors cause validation to fail.
Examples
The following example demonstrates how to ignore the ChainValidationResult.Untrusted error when you are connecting to a server that uses a self-signed certificate. The code adds the appropriate value to the IgnorableServerCertificateErrors list before calling ConnectAsync on the web socket. The server's self-signed certificate will not cause validation to fail, but other errors in validating the server certificate would still result in ConnectAsync failing.
private async void CreateAndConnectWebSocket()
{
var myWebSocket = new MessageWebSocket();
myWebSocket.Information.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted);
...
await myWebSocket.ConnectAsync(new Uri("wss://contoso.com/wsendpoint1"));
}