如何在console application.net中添加带有ssl证书的soap api引用



我是soap API的新手。我有一个外部肥皂API。我试图添加服务引用。但它显示证书错误。我在本地计算机中安装了证书。下方给出错误

The request was aborted: Could not create SSL/TLS secure channel.

请帮助我如何在visual studio的控制台应用程序中添加soap API。。。

//in .NET 4.0, TLS 1.2 is not supported, but if you have .NET 4.5 (or above) installed on the system
//then you still can opt in for TLS 1.2 even if your application framework doesn't support it.
//The only problem is that SecurityProtocolType in .NET 4.0 doesn't have an entry for TLS1.2,
//so we'd have to use a numerical representation of this enum value:
//ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
//instead of:
// ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;

您可以查看此页面:https://www.codeproject.com/Questions/1255767/Could-not-create-SSL-TLS-secure-channel