Modified 'Secure Connection'

This commit is contained in:
sta 2014-11-05 11:21:10 +09:00
parent 5e9157a3d4
commit 82db3b5ac6

View File

@ -419,7 +419,7 @@ If the server supports this extension, it returns the same header. And when your
### Secure Connection ###
websocket-sharp supports the **Secure Connection (SSL)**.
websocket-sharp supports the **Secure Connection** with **SSL**.
As a **WebSocket Client**, you should create an instance of the `WebSocket` class with the **wss** scheme WebSocket URL.
@ -429,10 +429,10 @@ using (var ws = new WebSocket ("wss://example.com")) {
}
```
And if you would like to set the custom validation for the server certificate, you should set the `WebSocket.ServerCertificateValidationCallback` property.
And if you would like to use the custom validation for the server certificate, you should set the `WebSocket.SslConfiguration.ServerCertificateValidationCallback` property.
```cs
ws.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => {
ws.SslConfiguration.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => {
// Do something to validate the server certificate.
...
@ -442,7 +442,7 @@ ws.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyE
If you set this property to nothing, the validation does nothing with the server certificate, and returns `true`.
As a **WebSocket Server**, you should create an instance of the `WebSocketServer` or `HttpServer` class with some settings for the secure connection, like the following.
As a **WebSocket Server**, you should create an instance of the `WebSocketServer` or `HttpServer` class with some settings for secure connection, like the following.
```cs
var wssv = new WebSocketServer (4649, true);