Solved

SSL certificate error

Posted on 2012-04-09
1
379 Views
Last Modified: 2012-04-11
I developed a tool to download files from sharepoint documnet Lib to server file location that use SSL(https).I cam up with error and I found the solution related to certificate policy
http://support.microsoft.com/kb/823177/ 

Looks like version different .I cant use the code below.


THis is my class
----------------------------------------------------------------------------------------------
Imports System.Net
Imports System.Security.Cryptography.X509Certificates
Public Class MyPolicy
  Implements ICertificatePolicy

  Public Function CheckValidationResult(ByVal srvPoint As ServicePoint, _
                ByVal cert As X509Certificate, ByVal request As WebRequest, _
                ByVal certificateProblem As Integer) _
            As Boolean Implements ICertificatePolicy.CheckValidationResult
    'Return True to force the certificate to be accepted.
    Return True
  End Function
End Class

-------------------------------------------------------------------------------------

This is the code i am using code before web service call.

System.Net.ServicePointManager.CertificatePolicy = New MyPolicy()


My Issue:

when i use the code line above It is saying
'System.Net.ServicePointManager.CertificatePolicy' is obsolete , please use ServerCertificateValidationCallback.

I search on the net but nothing stright forward.
Anyone come across same issue.




I am using VS 2008
0
Comment
Question by:goodgeek
1 Comment
 
LVL 10

Accepted Solution

by:
Najam Uddin earned 500 total points
ID: 37831024
This solution is not good to use in production environment. This code bypass validation of certificate. I would suggest to create certificate as described in following link
http://msdn.microsoft.com/en-us/library/ff648498.aspx.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial will show you how to add an attribute to an XML (http://en.wikipedia.org/wiki/XML) stream returned from a Windows Communication Foundation (http://en.wikipedia.org/wiki/Windows_Communication_Foundation) (WCF) Web Service.  Some knowled…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

29 Experts available now in Live!

Get 1:1 Help Now