0

i am working on a vb.net web service that calls another web service sitting on amazon. Now i initially wrote it for http and it is working alright. Now i need to use https and a couple of certificates are to be used. How do i go about writing the code ? Here is a snippet of what i am using for the http case.

Dim wr As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
    wr.Headers("Authorization") = "BASIC" & Space(1) & GenerateAuthHeader()
    wr.ContentType = Convert.ToString("multipart/related; boundary=") & boundary & Space(1) &      
    "start=<""" & startId & """>"
    wr.Method = "POST"
    wr.KeepAlive = True
    wr.Credentials = System.Net.CredentialCache.DefaultCredentials

To be more specific i want to know what needs to change here apart from the https URL which is obvious.

Som Bhattacharyya
  • 3,972
  • 35
  • 54
  • HttpWebRequest should be able to handle server certificates automatically. See [Using HTTPS and httpWebRequest](http://stackoverflow.com/questions/10389808/using-https-and-httpwebrequest). – Justin Ryan Nov 10 '14 at 10:12
  • Check this [question and answer](http://stackoverflow.com/questions/11153880/accessing-a-web-service-and-a-http-interface-using-certificate-authentication). It might help. – Stijn Nov 10 '14 at 10:33

0 Answers0