eatkin
Posts: 3
|
Posted: 04/07/2009, 3:24 PM |
|
I have an .net vb site that needs to connect to a secure web service to retrieve XML data.
In the CCS record beforeshow event we use an XMLReader to prefill some fields. This works fine from a local xml file, but I need to retrieve it from a URL of a third party using a certificate. I am fairly new to vb and don't know where to start to code the usage of the client certificate to allow the page to retrieve the required info.
The error i get is "System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel", which I assume is the requirement for the client cert.
Any guidance anyone can provide aroudn using a client certificate within a webpage to retrieve XML data from a secure site would be appreciated.
We are using .net 2.0, CCS 4.2
Thanks
Eric
|
|
|
Vasiliy
Posts: 378
|
Posted: 04/09/2009, 11:13 AM |
|
Code example:
________________________
' Ignore "Invalid SSL Certificate" issue
ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
' Call your web-service
Dim webservice As New DataExportProxy.DataExport()
webservice.BeginExecute(DataExportID, CustomFunctions.DatabaseSettings.GetClientVDir, Session("UserLogin"), UserPassword.ToString, Nothing, Nothing)
________________________
' DataExport Issue (Invalid SSL Certificate Issue)
Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
'Return True to force the certificate to be accepted.
Return True
End Function
________________________
_________________
Vasiliy |
|
|
|