【发布时间】:2019-05-28 10:44:40
【问题描述】:
我已经用 C# 编写了自己的网络服务器。
而且我总是在端口 443 上的新 IP 中为我的网站建立 SSL 证书。而且它总是可以正常工作。
但是这次我得到了这个错误:
安全连接失败
连接到 www.sayehrooshan-co.com 时出错。 SSL 收到超过最大允许长度的记录。错误代码:
SSL_ERROR_RX_RECORD_TOO_LONG
无法显示您尝试查看的页面,因为无法验证接收到的数据的真实性。 请联系网站所有者,告知他们此问题。
这是页面地址:
https://www.sayehrooshan-co.com
这是我的代码总是与其他网站的 .pfx 文件一起使用:
sslstream = new SslStream(new NetworkStream(mySocket, false), false);
//commented for nedaye arzhang
X509Certificate2 serverCertificate = new X509Certificate2(Path, Password);
//X509Certificate2 serverCertificate = new X509Certificate2("www_nedaye-arzhang_com.cer");
sslstream.AuthenticateAsServer(serverCertificate, false, System.Security.Authentication.SslProtocols.Tls, true);
搜索了很多,但没有得到任何解决方案 有人知道吗?
【问题讨论】:
标签: c# ssl ssl-certificate