简体   繁体   English

Invoke-WebRequest:请求被中止:无法创建 SSL/TLS 安全通道

[英]Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel

Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.
At line:4 char:6
+ $r = Invoke-WebRequest -Uri $url
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

my client is facing this issue while other application trying to hit my service.我的客户正面临这个问题,而其他应用程序试图访问我的服务。 i enabled TLS 1.1.我启用了 TLS 1.1。 and 1.2 on my server和 1.2 在我的服务器上

If the client is attempting to negotiate the request using TLS 1.0, but only TLS 1.1 and 1.2 are supported you will get this error.如果客户端尝试使用 TLS 1.0 协商请求,但仅支持 TLS 1.1 和 1.2,您将收到此错误。

Try forcing the client to utilize TLS 1.2 by adding the below code to the client's application before the request is made to your service.在向您的服务发出请求之前,尝试通过将以下代码添加到客户端的应用程序来强制客户端使用 TLS 1.2。

PowerShell:电源外壳:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

C#: C#:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

See:看:

Update .NET web service to use TLS 1.2 更新 .NET Web 服务以使用 TLS 1.2

Powershell Setting Security Protocol to Tls 1.2 Powershell 将安全协议设置为 TLS 1.2

The cause of the error is Powershell by default uses TLS 1.0 to connect to website, but website security requires TLS 1.2.错误原因是Powershell默认使用TLS 1.0连接网站,但网站安全需要TLS 1.2。 You can change this behavior with running any of the below command to use all protocols.您可以通过运行以下任何命令来更改此行为以使用所有协议。 You can also specify single protocol.您还可以指定单个协议。

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls, [Net.SecurityProtocolType]::Tls11, [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Ssl3
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"

U mean to say i should ask third party to add below code to their application before calling our service???你的意思是说我应该要求第三方在调用我们的服务之前将以下代码添加到他们的应用程序中???

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

that means the issue is on their site??这意味着问题出在他们的网站上?? because i have enabled all TLS version on our server.因为我在我们的服务器上启用了所有 TLS 版本。

暂无
暂无

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

相关问题 WebException:请求已中止:无法创建SSL / TLS安全通道 - WebException: The request was aborted: Could not create SSL/TLS secure channel 即使在指定ServicePointManager.SecurityProtocol之后,HttpWebRequest中的“请求已中止:无法创建SSL / TLS安全通道” - “The request was aborted: Could not create SSL/TLS secure channel” in HttpWebRequest, even after specifying ServicePointManager.SecurityProtocol 请求被中止无法在共享主机服务器C#上创建ssl / tls安全通道 - the request was aborted could not create ssl/tls secure channel on shared hosting server C# 请求已中止:无法创建SSL / TLS安全channel.System.Net.WebException - The request was aborted: Could not create SSL/TLS secure channel.System.Net.WebException 无法创建SSL / TLS安全通道 - 作为exe工作但不在asp.net mvc中工作 - Could not create SSL/TLS secure channel - works as exe but not in asp.net mvc 我如何修复 ASP.NET 中的无法创建 SSL/TLS 安全通道错误 - How do i fix the Could not create SSL/TLS secure channel Error in ASP.NET 无法使用 IIS 的权限为 SSL/TLS 建立安全通道 - Could not establish secure channel for SSL/TLS with authority from IIS 无法为具有权限“本地主机”的SSL / TLS安全通道建立信任关系 - Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost' strange issue Amazon S3错误 - 无法为SSL / TLS安全通道建立信任关系 - Amazon S3 error - Could not establish trust relationship for the SSL/TLS secure channel IE中的Ajax请求随机中止 - Ajax request randomly aborted in IE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM