I am trying to access a REST webservice, however my code doesn't work and keeps throwing a HTTP 401 error
see this example screen cap from Wireshark of the initial ssl request:
This is from a Curl call to the same web address with the same details. The issue is that under my VB.NET version the "Extension: server_name" (and related) part of the SSL packet is missing, I believe that this is causing the server to not reply with the Server key exchange in the next couple packets.
Below is the VB.NET code
Dim webRequest As HttpWebRequest = DirectCast(System.Net.WebRequest.Create(UrlString), HttpWebRequest)
webRequest.Method = "GET"
webRequest.ContentType = "application/x-www-form-urlencoded"
webRequest.Credentials = New NetworkCredential(username, password)
Dim response As HttpWebResponse = DirectCast(webRequest.GetResponse(), HttpWebResponse)
This fails on the last line (HTTP 401 error), issue does not seem to be related to my proxy and the user credentials are correct for the server as this request works from Curl and wget.
I have already tried setting the AuthenticationLevel as well as manually setting the Authorization header, and PreAuthenticate doesn't seem to change this issue either.