1.首先尝试将TLS版本设置为1.2,以确保安全性和兼容性。可以将以下行添加到Web.config文件中:
2.将弱密码套件禁用,例如RC4:
3.通过以下代码在应用程序启动时禁用RC4:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.Expect100Continue = false; ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3; ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls; ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls11; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls11; ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.RSASha1; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;