I am trying to get HTTPS working as the website doesn’t support HTTP so followed the sample for TLS and the client sample in the documentation section of the website. What I am unsure of is where I should get the cert for this. Do I get this from the website I am trying to connect to? The sample is for google.com
I exported the cert for ecowitt.net and added this to the resources and added the code to add the cert and set the HttpsAuthenCerts to the cert. I get the following from the website:
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (3) ####
#### Message:
#### GHIElectronics.TinyCLR.Devices.Network.Provider.NetworkControllerApiWrapper::AuthenticateAsClient [IP: 0000] ####
#### System.Net.Security.SslStream::AuthenticateAsClient [IP: 0016] ####
#### System.Net.Security.SslStream::AuthenticateAsClient [IP: 0009] ####
#### System.Net.Security.SslStream::AuthenticateAsClient [IP: 0008] ####
#### System.Net.HttpWebRequest::EstablishConnection [IP: 0251] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####
#### TinyCLRClockLCD7.WeatherDataClass::FetchWeatherDataLocal [IP: 005a] ####
#### TinyCLRClockLCD7.Program::wifiBackgroundThreadHandler [IP: 004e] ####
If I try to use just HTTP I get this from the server:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<h1>301 Moved Permanently</h1>
<p>The requested resource has been assigned a new permanent URI.</p>
<hr/>Powered by Tengine</body>
</html>