Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md on how to change SSL Protocol #583

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Backup*
_UpgradeReport_Files
bin
obj
.vs

*.mdb
*.pdb
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language: csharp
solution: websocket-sharp.sln
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ ws.SslConfiguration.ServerCertificateValidationCallback =

The default callback always returns `true`.

If you need to specify SSL protocol, you could change the enum, for example:

```csharp
ws.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.None
```

As a WebSocket server, you should create a new instance of the `WebSocketServer` or `HttpServer` class with some settings for the secure connection, such as the following.

```csharp
Expand Down Expand Up @@ -641,6 +647,12 @@ And if you would like to output a log, you should use any of the output methods.
ws.Log.Debug ("This is a debug message.");
```

If you would like to disable all log output, you can specify the `None` enum.

```csharp
ws.Log.Level = LogLevel.None;
```

The `WebSocketServer` and `HttpServer` classes have the same logging function.

## Examples ##
Expand Down
7 changes: 6 additions & 1 deletion websocket-sharp/LogLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public enum LogLevel
/// <summary>
/// Specifies the top logging level.
/// </summary>
Fatal
Fatal,

/// <summary>
/// No log
/// </summary>
None
}
}
7 changes: 7 additions & 0 deletions websocket-sharp/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,18 @@ public void Error (string message)
/// <summary>
/// Outputs <paramref name="message"/> as a log with <see cref="LogLevel.Fatal"/>.
/// </summary>
/// <remarks>
/// If the current logging level is higher than <see cref="LogLevel.Fatal"/>,
/// this method doesn't output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
/// A <see cref="string"/> that represents the message to output as a log.
/// </param>
public void Fatal (string message)
{
if (_level > LogLevel.Fatal)
return;

output (message, LogLevel.Fatal);
}

Expand Down