Solved

SSL certificate error

Posted on 2012-04-09
1
380 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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 shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 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