Request to the site on HTTPS protocol

  • 12 years ago


    Maybe someone knows how to program request to the web server on the HTTPS protocol.
    That's part of the code:

    Dim myHttpWebRequest As HttpWebRequest = HttpWebRequest.Create("")
    Dim clsCert As System.Security.Cryptography.X509Certificates.X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromCertFile("c:\hosting.cer")
    CType(myHttpWebRequest, System.Net.HttpWebRequest).ClientCertificates.Add(clsCert)
    myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, sCookiesHTTPS)
    myHttpWebResponse = myHttpWebRequest.GetResponse()

    In fulfilling the request GetResponse () issued a message on the console:
    "The remote certificate is invalid according to the validation procedure"

    After many hours of searching on the Internet so I understood what the problem is not the certificate. Many people there is this message, but real examples of how effective it is to win, I did not find it.

    Help. Maybe someone is already programmed.


Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The difference between theory and practice is smaller in theory than in practice.”