该请求被中止:无法在CSOM中创建SSL/TLS安全通道
在以下错误之下,请建议任何解决方案。
该请求被中止:无法在Windows Server2012 R2上创建SSL/TLS Secure Channel 。在ClientContext.executequery上。
CSOM SharePoint的代码:
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;
using (ClientContext ctx = new ClientContext("test.SharePoint.Com"))
{
try
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
SecureString securePassword = new SecureString();
foreach (char c in "test")
securePassword.AppendChar(c);
ctx.Credentials = new SharePointOnlineCredentials("test.com", securePassword);
Web web = ctx.Web;
ctx.Load(web);
ctx.ExecuteQuery(); //The request was aborted: Could not create SSL/TLS secure channel.
Console.WriteLine("The web site title: " + web.Title);
Console.Read();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
谢谢。
Getting below error, Please suggest any solution.
The request was aborted: Could not create SSL/TLS secure channel on windows server2012 R2. at clientContext.ExecuteQuery.
Code for CSOM SharePoint:
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;
using (ClientContext ctx = new ClientContext("test.SharePoint.Com"))
{
try
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
SecureString securePassword = new SecureString();
foreach (char c in "test")
securePassword.AppendChar(c);
ctx.Credentials = new SharePointOnlineCredentials("test.com", securePassword);
Web web = ctx.Web;
ctx.Load(web);
ctx.ExecuteQuery(); //The request was aborted: Could not create SSL/TLS secure channel.
Console.WriteLine("The web site title: " + web.Title);
Console.Read();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论