TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hesaam jj
NA
1
0
Convert to vb.net
Jan 4 2013 1:27 PM
public class PermissiveCertificatePolicy
{
private PermissiveCertificatePolicy()
{
}
private readonly string subjectName;
private static PermissiveCertificatePolicy currentPolicy;
PermissiveCertificatePolicy(string subjectName)
{
this.subjectName = subjectName;
ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(RemoteCertValidate);
}
public static void Enact(string subjectName)
{
currentPolicy = new PermissiveCertificatePolicy(subjectName);
}
bool RemoteCertValidate(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error)
{
if (subjectName == "*")
{
return true;
}
else if (cert.Subject == subjectName)
{
return true;
}
else return false;
}
}
Attachment:
permissivecertificatepolicy.zip
Reply
Answers (
2
)
convert to vb.net
C# obtain data from file name