You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest, Boolean renegotiation)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger log) in D:\WebSocketSharp\websocket-sharp\websocket-sharp\Net\WebSockets\TcpListenerWebSocketContext.cs:line 93
at WebSocketSharp.Server.WebSocketServer.<>c__DisplayClass66_0.b__0(Object state) in D:\WebSocketSharp\websocket-sharp\websocket-sharp\Server\WebSocketServer.cs:line 791
The text was updated successfully, but these errors were encountered:
akramire
changed the title
WebSocket Server with a HTTP Server is causing the error message below every 5 seconds
WebSocket Server is causing the error message below every 5 seconds
Sep 13, 2023
Adding more information about the issue.
As soon as the service starts every 5 seconds the error message happens.
This is the source code.
using System;
using System.Configuration;
using System.Security.Cryptography.X509Certificates;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace Example2
{
public class Program
{
public static void Main (string[] args)
{
// Create a new instance of the WebSocketServer class.
//
// If you would like to provide the secure connection, you should
// create a new instance with the 'secure' parameter set to true or
// with a wss scheme WebSocket URL.
int puerto = int.Parse(ConfigurationManager.AppSettings["Puerto"]);
var wssv = new WebSocketServer (puerto,true);
#if DEBUG
// To change the logging level.
wssv.Log.Level = LogLevel.Trace;
wssv.Log.File = @"C:\log\TraceProtocol.log";
#endif
// To provide the secure connection.
var cert = ConfigurationManager.AppSettings["ServerCertFile"];
var passwd = ConfigurationManager.AppSettings["CertFilePassword"];
wssv.SslConfiguration.ServerCertificate = new X509Certificate2(cert, passwd);
wssv.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
wssv.SslConfiguration.CheckCertificateRevocation = false;
wssv.SslConfiguration.ClientCertificateRequired = false;
wssv.SslConfiguration.ClientCertificateValidationCallback = null;
// Add the WebSocket services.
wssv.AddWebSocketService<Echo> ("/Echo");
wssv.AddWebSocketService<Chat> ("/Chat");
wssv.Start ();
if (wssv.IsListening) {
Console.WriteLine ("Listening on port {0}, and providing WebSocket services:", wssv.Port);
foreach (var path in wssv.WebSocketServices.Paths)
Console.WriteLine ("- {0}", path);
}
Console.WriteLine ("\nPress Enter key to stop the server...");
Console.ReadLine ();
wssv.Stop ();
}
[9/9/2023 4:37:00 AM] DEBUG <>c__DisplayClass66_0.b__0:791
System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest, Boolean renegotiation)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger log) in D:\WebSocketSharp\websocket-sharp\websocket-sharp\Net\WebSockets\TcpListenerWebSocketContext.cs:line 93
at WebSocketSharp.Server.WebSocketServer.<>c__DisplayClass66_0.b__0(Object state) in D:\WebSocketSharp\websocket-sharp\websocket-sharp\Server\WebSocketServer.cs:line 791
The text was updated successfully, but these errors were encountered: