Solved

SSL certificate error

Posted on 2012-04-09
1
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
return value async webservice 9 111
Consuming WCF Web Service in ASP.NET 7 49
ajax + ASP.NET. Is SSL a way to provide security on this setup? 2 87
web services wcf 2 131
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…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…

737 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