Provider: SSL Provider, error: 0 – The client and server cannot communicate, because they do not possess a common algorithm–Dynamics 365 Performance Test
Error:
Web Test validation test failed with below error:
Provider: SSL Provider, error: 0 – The client and server cannot communicate, because they do not possess a common algorithm.
Reason:
This is because, Wen Test works with lower System.Net protocols. But, our CRM server enabled with TLS1.2 (Higher Protocol). Hence, Web Test run throws error. [This happens when we access CRM with https://%5D
Solution:
Need to assign higher Protocols to Web test when it is running. This we could achieve by creating a “Web Test Plug-in”. PFB steps to achieve this.
1. Create a Class Library
2. Add Below reference:
Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
3. Create a class with Code
using System;
using System.ComponentModel;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Microsoft.VisualStudio.TestTools.WebTesting;
namespace PerformanceTest.Plugins
{
[Description(“This plugin will force the underlying System.Net ServicePointManager to use TLS1.2”)]
public class TLS12ForcedPlugin : WebTestPlugin
{
[Description(“Enable or Disable the plugin functionality”)]
[DefaultValue(true)]
public bool Enabled { get; set; }
public override void PreWebTest(object sender, PreWebTestEventArgs e)
{
base.PreWebTest(sender, e);
//Using TLS1.2. Without this line, nothing works.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB;
e.WebTest.AddCommentToResult(this.ToString() + ” has made the following modification-> ServicePointManager.SecurityProtocol set to use TLS1.2 in WebTest Plugin.”);
}
public static bool RemoteCertificateValidationCB(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
}
}
4. Build Class Library
5. Add this Class Library referent into “Performance Test” project where Web test exists
6. Right click on root node of “Web Test”
7. Select “Add Web Test Plug-in”
8. Select the Plug-in “TLS12ForcedPlugin”
This was originally posted here.

Like
Report
*This post is locked for comments