无法使用权限“......”为 SSL/TLS 建立安全通道,但代码中设置了 TLS。在本地机器上工作正常但在生产环境中不工作
Could not establish secure channel for SSL/TLS with authority "......" but TLS is set in the code. Works fine on local machine but not in Production
我正在尝试使用此代码达到 API 但它在 PROD 服务器上不起作用,我不知道为什么。在本地,它在我的笔记本电脑上运行良好。
/*ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;*/
_client = new HttpBinding<ThalentoWebservicePortType>(@Uri, System.ServiceModel.Channels.MessageVersion.Soap11, (binding, httpTransport, address, factory) =>
{
var basicAuthBehavior = new BasicAuthBehavior(UserName, Password);
factory.Endpoint.Behaviors.Add(basicAuthBehavior);
});
我正在使用 .NET Framework 4.6.1
非常感谢您的帮助,因为我对这个问题感到困惑...:-)
欢迎使用 Whosebug!
确保 prod 服务器(当然还有客户端)本身支持 TLS1.2 - 一些 windows 服务器版本必须通过更新获得它,并且考虑到 net461 我猜你的工作速度相当慢跟我一样的搬家公司。 2016 年默认启用,但我认为 2012 年需要更新。
如果您仍然是 运行 2008 服务器 - 将其升级到更新的服务器。那个是EOL。
我正在尝试使用此代码达到 API 但它在 PROD 服务器上不起作用,我不知道为什么。在本地,它在我的笔记本电脑上运行良好。
/*ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;*/
_client = new HttpBinding<ThalentoWebservicePortType>(@Uri, System.ServiceModel.Channels.MessageVersion.Soap11, (binding, httpTransport, address, factory) =>
{
var basicAuthBehavior = new BasicAuthBehavior(UserName, Password);
factory.Endpoint.Behaviors.Add(basicAuthBehavior);
});
我正在使用 .NET Framework 4.6.1
非常感谢您的帮助,因为我对这个问题感到困惑...:-)
欢迎使用 Whosebug!
确保 prod 服务器(当然还有客户端)本身支持 TLS1.2 - 一些 windows 服务器版本必须通过更新获得它,并且考虑到 net461 我猜你的工作速度相当慢跟我一样的搬家公司。 2016 年默认启用,但我认为 2012 年需要更新。
如果您仍然是 运行 2008 服务器 - 将其升级到更新的服务器。那个是EOL。