简体   繁体   English

通过tls 1.2调用AWS C#SDK时出错

[英]Error while invoking Aws C# SDK through tls 1.2

Paypal will soon imposed to use TLS 1.2 when contacting their API. Paypal在联系其API时将很快被要求使用TLS 1.2。 This behavior already been enforced on their Sandbox. 此行为已在其沙盒中强制执行。

We just been trapped by a side effect is that after invoking Paypal API any subsequent call to AWS SDK are failing. 我们只是被一个副作用所困,就是调用Paypal API之后,对AWS开发工具包的任何后续调用都将失败。

Anybody had the same problem and found a workaround ? 任何人都有相同的问题,找到了解决方法?

As noted by this discussion on the AWS developer forums , at the time of this posting TLS 1.2 is not supported by the AWS SDK. 正如AWS开发人员论坛上的讨论所指出的那样,在此发布之时, AWS开发工具包不支持TLS 1.2。 Consequently, you won't be able to move to TLS 1.2 exclusively in your application until they also implement support for it. 因此,除非他们也实现对TLS 1.2的支持,否则您将无法仅将其迁移到TLS 1.2。

A workaround exists where your application's communication protocol can be manually set. 存在一种解决方法,可以手动设置应用程序的通信协议。 In the example below, ServicePointManager.SecurityProtocol is updated to enable support for TLS 1.0, TLS 1.1, and/or TLS 1.2 in the application: 在下面的示例中,ServicePointManager.SecurityProtocol已更新,以在应用程序中启用对TLS 1.0,TLS 1.1和/或TLS 1.2的支持:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

This change should allow your communication to communicate to PayPal with TLS 1.2, while falling back to older versions as necessary for communication with AWS SDK. 此更改应允许您的通信通过TLS 1.2与PayPal进行通信,同时根据需要使用AWS SDK进行通信时回退到旧版本。

Notes: 笔记:

  • Manually setting this puts a burden of responsibility on you to periodically review this and eventually remove support for older TLS versions as they become unnecessary and/or security risks. 手动设置此项会给您带来责任,需要您定期检查此问题,并最终删除对旧版TLS版本的支持,因为它们不再是必需的和/或安全风险。 This is the motivation for PCI-compliant APIs moving to TLS 1.2. 这是将符合PCI标准的API迁移到TLS 1.2的动机。 Keep an eye on updates to the AWS SDK for .NET so that you'll be able to drop older TLS support as soon as possible. 密切注意适用于.NET的AWS开发工具包的更新,以便您能够尽快放弃旧的TLS支持。
  • Tls11 and Tls12 are only available in the SecurityProtocolType enum for .NET versions 4.5+. Tls11Tls12仅在.NET 4.5+版本的SecurityProtocolType枚举中可用。

Further Reading: 进一步阅读:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM