When I'm running my Netduino 3 WiFi I get the following error trying to connect to an Azure Mobile Services endpoint to do a POST
Microsoft.SPOT.Net.Security.SslStream::Authenticate Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsClient System.Net.HttpWebRequest::EstablishConnection System.Net.HttpWebRequest::SubmitRequest System.Net.HttpWebRequest::GetRequestStream Igloocoder.MF.AzureMobileServices.MobileServiceEndpoint::Insert Igloocoder.BbqDuino.Program::TakeTemperatureReading
The code being executed is as follows:
public HttpWebResponse Insert(string table, string json) { var request = (HttpWebRequest) WebRequest.Create("https://myazuremobileservice.azure-mobile.net/tables/" + table); request.Method = "POST"; request.Accept = "application / json"; request.ContentType = "application / json; charset = UTF-8 "; request.ContentLength = json.ToCharArray().Length; request.Headers.Add("X-ZUMO-APPLICATION", "myApplicationKey"); using (var streamWriter = new StreamWriter(request.GetRequestStream())) { streamWriter.Write(json); streamWriter.Flush(); streamWriter.Close(); } using (var response = (HttpWebResponse) request.GetResponse()) { return response; } }
The exception is being thrown on the line with "using (var streamWriter" at the start of it. The only thing available is the stack trace at the start of this post. There is no inner exception and the message is "Exception was thrown: System.Exception"
I did some research and found a few posts on this forum but none of them seem to have any confirmed fixes. The closest I got was to use MFDeploy and do "Target | Manage Device Keys | Update SSL Seed" which outputs the following
Updating SSL seed... request configured Update Complete!
Any guidance, ideas or general thoughts would be appreciated.