SuperSocket icon indicating copy to clipboard operation
SuperSocket copied to clipboard

SuperSocket.WebScoket.Server 2.0,使用ssl证书报错

Open lovefather opened this issue 1 year ago • 3 comments

程序集版本:2.0.0-beta.24

客户端每次重连的时候就会报如下错误

info: SuperSocketService[0] The listener [Ip=any, Port=8080, Security=Tls12, Path=, BackLog=0, NoDelay=False] has been started. info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: D:\Code\Github\lovefather\GW\GWApp\GW.LivesServer\bin\Debug\net8.0 fail: IConnection[0] Exception happened in ReceiveAsync System.IO.IOException: The decryption operation failed, see inner exception. ---> System.ComponentModel.Win32Exception (0x80090327): 处理证书时,出现了一个未知错误。 --- End of inner exception stack trace --- 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 SuperSocket.Connection.StreamPipeConnection.FillPipeWithDataAsync(Memory1 memory, CancellationToken cancellationToken) at SuperSocket.Connection.PipeConnection.FillPipeAsync(PipeWriter writer, ISupplyController supplyController, CancellationToken cancellationToken)

image

配置代码如下: ` builder.ConfigureSuperSocket(options => { options.Name = "vtool.com.cn";

options.AddListener(new ListenOptions()
{
    Ip = "any",
    Port = 8080,
    Security = SslProtocols.Tls12,
    CertificateOptions = new CertificateOptions()
    {
        FilePath = "vtool.com.cn.pfx",
        Password = "4gx3gatr"
    }
});

}); `

证书是从阿里云生成的个人免费SSL证书,密码没问题,验证过 image

请问可能是什么原因导致的

lovefather avatar Aug 08 '24 14:08 lovefather

启动正常,与客户端通信时出错。你把证书在certmgr里面打开看看?

kerryjiang avatar Oct 26 '24 16:10 kerryjiang

也遇到同样问题

dodu2014 avatar Jun 19 '25 13:06 dodu2014