My experience:
I have developed one webpart and it was working fine on my development server with http:// protocol but when i deployed that webpart on production server where SSL was configured on website. After deployment of webpart production server started giving error e.g. Access denied even if user has FULLControl or Owner or Administrator
I have just created below class and call call it from my webpart constructor
/====================================================================
// trustedCertificatePolicy.cs
//====================================================================
using System;
using System.Net;
using System.Security;
using System.Security.Cryptography.X509Certificates;
namespace myApp
{
public class trustedCertificatePolicy : System.Net.ICertificatePolicy
{
public trustedCertificatePolicy() {}
public bool CheckValidationResult
(
System.Net.ServicePoint sp,
System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Net.WebRequest request, int problem)
{
return true;
}
}
}
Validate SSL Certificate from your webpart code mention below:
….
//construcor of my class
public LoginToolPart()
{
this.ID = “LoginToolPart”;
// call method from above implemented trustedCertificatePolicy class
System.Net.ServicePointManager.CertificatePolicy = new trustedCertificatePolicy();
}
Hope this will solve your problem
Cheer!!!
Recent Comments