@S Abijith , after you installed the certificate in the website, you could try to use HttpWebRequest.ServerCertificateValidationCallback Property to set a callback function to validate the server certificate.
Here is a code example you could refer to.
static void Main(string[] args)
{
HttpWebRequest request = WebRequest.CreateHttp("url");
request.ServerCertificateValidationCallback += ValidateServerCertificate;
}
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
if (sslPolicyErrors == SslPolicyErrors.None)
{
Console.WriteLine("Certificate is valid");
return true;
}
else
{
Console.WriteLine("Certificate error: {0}", sslPolicyErrors);
// Do not allow this client to communicate with unauthenticated servers.
return false;
}
}
Best Regards,
Jack
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.