Fix due to the modified WebSocket.cs
This commit is contained in:
@@ -31,13 +31,13 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using WebSocketSharp.Net.Security;
|
||||
|
||||
namespace WebSocketSharp.Net {
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace WebSocketSharp.Net {
|
||||
if (!secure) {
|
||||
stream = net_stream;
|
||||
} else {
|
||||
var ssl_stream = new SslStream(net_stream);
|
||||
var ssl_stream = new SslStream(net_stream, false);
|
||||
ssl_stream.AuthenticateAsServer(cert);
|
||||
stream = ssl_stream;
|
||||
}
|
||||
|
83
websocket-sharp/Net/Security/SslStream.cs
Normal file
83
websocket-sharp/Net/Security/SslStream.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
#region MIT License
|
||||
/**
|
||||
* SslStream.cs
|
||||
*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2012 sta.blockhead
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace WebSocketSharp.Net.Security {
|
||||
|
||||
public class SslStream : System.Net.Security.SslStream
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public SslStream(NetworkStream innerStream)
|
||||
: base(innerStream)
|
||||
{
|
||||
}
|
||||
|
||||
public SslStream(NetworkStream innerStream, bool leaveInnerStreamOpen)
|
||||
: base(innerStream, leaveInnerStreamOpen)
|
||||
{
|
||||
}
|
||||
|
||||
public SslStream(
|
||||
NetworkStream innerStream,
|
||||
bool leaveInnerStreamOpen,
|
||||
RemoteCertificateValidationCallback userCertificateValidationCallback
|
||||
) : base(innerStream, leaveInnerStreamOpen, userCertificateValidationCallback)
|
||||
{
|
||||
}
|
||||
|
||||
public SslStream(
|
||||
NetworkStream innerStream,
|
||||
bool leaveInnerStreamOpen,
|
||||
RemoteCertificateValidationCallback userCertificateValidationCallback,
|
||||
LocalCertificateSelectionCallback userCertificateSelectionCallback
|
||||
) : base(
|
||||
innerStream,
|
||||
leaveInnerStreamOpen,
|
||||
userCertificateValidationCallback,
|
||||
userCertificateSelectionCallback
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
public bool DataAvailable {
|
||||
get {
|
||||
return ((NetworkStream)InnerStream).DataAvailable;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user