asp.net consultancy chorley ASP.NET Server Side Scripting Wigan
Website Development Radcliffe

IT Services And Support

Email : ren@techsolus.co.uk
Mobile Phone : 0788 68 41 411
Answerphone : 01204 469683
bespoke invoice systems Standish Information Technology Advice Worsley
    development systems Ramsbottom
data manipulation Farnworth access databases Whitefield SQL connections Atherton
online accessible software Leyland software compatible Coppull


Get connected and Online Tottington
remote management Makerfield code and design Aspull

The remote certificate is invalid according to the validation procedure. - Fix In VB Visual Basic - 26/02/2011

You're trying to do a HTTPS post to a site that has an invalid certificate, or some other issue is getting in the way of the certificate validiation.  You do your code and you recive the message
The remote certificate is invalid according to the validation procedure.
Of course you've trawled the internet and seen countless C and C# so called solutions, but if like me you prefer VB...you're still scuppered.

Here's the code solution.

<% @ Import Namespace = "System.net" %>
<% @ Import Namespace = "System.Security.Cryptography.X509Certificates" %>
<% @ Import Namespace = "System.Net.Security" %>

sub dohttppost(sender as object, e as eventargs)
  Net.ServicePointManager.ServerCertificateValidationCallback = AddressOf validateCert

 .....do your https request here
......make sure this bit is working to the point where you receive the
......"The remote certificate is invalid according to the validation procedure."        
......error
end sub

Function validateCert(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
 Return True
End Function


Please  DO NOT ask me to explain.  I took this from Here

What you are achieving is ignoring the certificate.  If you're confident in your code, the application is not really really secure and all that then fine, otherwise keep onlooking, this is simply a workaround

Post A Comment

Name Comment
Jose Lee Thank you, thank you, thank you.
programming services asp.net specialist
Valid XHTML 1.0 Transitional
Admin
GD