Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bypass Certificate
Message
From
10/11/2007 11:23:05
Aida I. Rivera
Air Information Systems
San Juan, Puerto Rico
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Web Services
Title:
Bypass Certificate
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01268221
Message ID:
01268221
Views:
70
Hi all:

I need to bypass a test site security certificate to be able to send files to the server. This server was setup by an insurance company and is working but they didn't buy the certificate for the test site they are so cheap that they copied the prodution site certificate so everything fails because the site name for the certificate is different than the test actual site. Playing with IE, I managed to connect to the service and retrieve the wsdl, make the programs to send the files and requests but have not been able to actually send the file because of this problem.

They sent me the following code in Visual Basic to bypass the certificate:

Create a class as follows:

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
End Function
End Class

When you proceed to call the web service, before creating an instance of the web reference, create an instance of the class as follows:

System.Net.ServicePointManager.CertificatePolicy = New MyPolicy

and then proceed to use the web service.

Have somebody bypassed a security certificate before, how can be done in VFP.

I downloaded C# and tried to make a class in C# to see if I could create the class and use it in VFP as follows:

public class MyPolicy : ICertificatePolicy {
public bool
ICertificatePolicy.CheckValidationResult(ServicePoint
srvPoint, X509Certificate cert, WebRequest request, int
certificateProblem)
{
return true;
}
}

but is giving me all kind of errors, due to my inexperience with C# (never used it before).

Can somebody done this before and can help me? Can somebody create the class for me in C# with code given? I'm willing to pay for these services if necessary. I've been working for five months creating all the programs and its extremely frustrating not to be able to start the tests that must be completed before January 31, 2008 after working for 5 months in the programs because of the invalid certificate.

Regards,

AiR
Aida I. Rivera-Benítez
AiR Information Systems
San Juan, Puerto Rico
air@abac.com
Next
Reply
Map
View

Click here to load this message in the networking platform