庆军之FastTunnel中转服务端加载证书
问题,仅在中转服务端加载证书,客户端不需要使用证书,方便证书过期了,仅在服务端加载即可。
解决方案:
ForwardDispatcher.cs
DispatchAsync中处理
using (var stream1 = await tcs.Task.WaitAsync(TimeSpan.FromSeconds(10)))
using (var stream2 = new NetworkStream(_socket, true) { ReadTimeout = 1000 * 60 * 10 })
using (SslStream stream = new SslStream(stream2))
{
stream.AuthenticateAsServer(Get(),false,false);//证书的处理
await Task.WhenAny(stream1.CopyToAsync(stream), stream.CopyToAsync(stream1));
}