Solved

SSL certificate error

Posted on 2012-04-09
1
376 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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In previous Articles, we have discussed how we can upload a file using .asmx web service and isolated storage space. Here, in continuation to the topic, I am going to discuss how we can use WCF for the same purpose. Steps: 1.Create the silverli…
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…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

6 Experts available now in Live!

Get 1:1 Help Now