Skip to content

authentication bug,if sever has pre-shared key ,client cann't authenticate and will be server remove #325

@andyhebear

Description

@andyhebear
Image

2025-07-24 17:27:39.471 +08:00 [INF] 已成功连接到服务器
2025-07-24 17:27:39.477 +08:00 [INF] [WatsonTcpClient] authentication required by server; please authenticate using pre-shared key
2025-07-24 17:27:39.478 +08:00 [INF] 身份认证-密码
2025-07-24 17:27:39.478 +08:00 [INF] [WatsonTcpClient] connected to 127.0.0.1:32132
2025-07-24 17:27:39.483 +08:00 [ERR] 客户端网络异常:System.IO.IOException: Unable to read data from the transport connection: 你的主机中的软件中止了一个已建立的连接。.
---> System.Net.Sockets.SocketException (10053): 你的主机中的软件中止了一个已建立的连接。
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync(Socket socket, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.ReceiveAsync(Memory1 buffer, SocketFlags socketFlags, Boolean fromNetworkStream, CancellationToken cancellationToken) at System.Net.Sockets.NetworkStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken)
at System.Net.Security.SslStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at WatsonTcp.WatsonMessageBuilder.BuildFromStream(Stream stream, CancellationToken token)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at WatsonTcp.WatsonMessageBuilder.BuildFromStream(Stream stream, CancellationToken token)
at WatsonTcp.WatsonTcpClient.DataReceiver(CancellationToken token)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at WatsonTcp.WatsonTcpClient.DataReceiver(CancellationToken token)
at WatsonTcp.WatsonTcpClient.b__62_0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
--- End of stack trace from previous location ---

--- End of inner exception stack trace ---
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Threading.Tasks.ValueTask1.GetTaskForValueTaskSource(IValueTaskSource`1 t)
--- End of stack trace from previous location ---
at WatsonTcp.WatsonMessageBuilder.BuildFromStream(Stream stream, CancellationToken token)
at WatsonTcp.WatsonTcpClient.DataReceiver(CancellationToken token)
2025-07-24 17:27:39.488 +08:00 [INF] [WatsonTcpClient] disposing
2025-07-24 17:27:39.490 +08:00 [INF] [WatsonTcpClient] disconnecting from 127.0.0.1:32132

025-07-24 17:38:56.270 +08:00 [INF] 运行模式: 被控端 监听IP:32132:32132
2025-07-24 17:38:56.305 +08:00 [INF] [WatsonTcpServer] starting with SSL on 0.0.0.0:32132
2025-07-24 17:38:56.307 +08:00 [INF] Server Started
2025-07-24 17:38:56.308 +08:00 [INF] 被控端已启动,等待连接...
2025-07-24 17:39:01.214 +08:00 [WRN] [WatsonTcpServer] no authentication material for [9f234650-5563-4d5e-83d9-007bdff0f408|127.0.0.1:64101]
2025-07-24 17:39:01.216 +08:00 [INF] 控制端: =>127.0.0.1:64101 下线
2025-07-24 17:39:01.217 +08:00 [INF] 客户端已断开: 127.0.0.1:64101,原因: Removed
2025-07-24 17:52:32.350 +08:00 [INF] 运行模式: 被控端 监听IP:32132:32132
2025-07-24 17:52:32.389 +08:00 [INF] [WatsonTcpServer] starting with SSL on 0.0.0.0:32132
2025-07-24 17:52:32.392 +08:00 [INF] Server Started
2025-07-24 17:52:32.392 +08:00 [INF] 被控端已启动,等待连接...
2025-07-24 17:52:41.883 +08:00 [WRN] [WatsonTcpServer] no authentication material for [54ba3cd9-9fe6-41b0-a856-9b7d7945cc15|127.0.0.1:1036]
2025-07-24 17:52:41.886 +08:00 [INF] 控制端: =>127.0.0.1:1036 下线
2025-07-24 17:52:41.887 +08:00 [INF] 客户端已断开: 127.0.0.1:1036,原因: Removed
2025-07-24 17:57:27.749 +08:00 [INF] 运行模式: 控制端 (连接到 127.0.0.1:32132)
2025-07-24 17:57:27.812 +08:00 [INF] [WatsonTcpClient] connecting with SSL to 127.0.0.1:32132
2025-07-24 17:57:29.857 +08:00 [ERR] [WatsonTcpClient] exception encountered: 由于目标计算机积极拒绝,无法连接。
2025-07-24 17:57:29.880 +08:00 [ERR] 客户端网络异常:System.Net.Sockets.SocketException (10061): 由于目标计算机积极拒绝,无法连接。
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.TaskToAsyncResult.End(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at WatsonTcp.WatsonTcpClient.Connect()
2025-07-24 17:57:29.893 +08:00 [ERR] 启动主控端错误: 由于目标计算机积极拒绝,无法连接。
2025-07-24 17:57:29.894 +08:00 [INF] 将在 30 秒后尝试重新连接...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions