Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Upload data to HTTPS website
#1

Hi everyone

For some time now I have been using the option to upload my air quality data directly to my website using the "Air Quality Monitor - Upload data to My Server" which passes a string of data directly to my website for processing.

Recently my website host has advised that I should start adopting "https" and not "http". I have changed and updated my site to now support this change.

There is one thing that I cannot get right however which is having my weather station pass data directly to my web server when I have "Redirect from http to https" enabled on my web server. "Enhances the security of website's visitors by setting up a permanent, SEO-safe 301 redirect from the insecure HTTP to the secure HTTPS version of the website."

Have any other users come across this issue before?

I have tried the following changes with no success:
* Changing the port number from "80" (http) to "433" (https)
 
Code:
// Send AQM data to My Server
    if (wifi.createTCP(mux_id, My_Server, 443, 0))
    {
      #ifdef PRINT_DEBUG_MYSERVER_UPLOAD
         Serial.println(F("Connection OK"));
      #endif
      wifi.send(mux_id, (const uint8_t*)Data.c_str(), strlen(Data.c_str()));      
    }

* Changing the web header to "https"
 
Code:
Data += " HTTPS/1.0\r\nHost: ";  //WebHeader_0;  //  " HTTPS/1.0\r\nHost: "

* Changing "My_Server" variable to "https://palmyweather.co.nz";
 
Code:
const char* My_Server                = "palmyweather.co.nz";              // Put here your server address
const char* Path_To_LogToSQL_PHPfile = "/XXXXXXXX/AirQuality_LogToSQL.php";     // Name and path to AirQuality_LogToSQL.php file on My Server


Any ideas on a way to fix this would be much appreciated.

Kind regards,
Matt
Reply
#2

(29-05-2023, 03:05)Palmyweather Wrote:  Recently my website host has advised that I should start adopting "https" and not "http". I have changed and updated my site to now support this change.

There is one thing that I cannot get right however which is having my weather station pass data directly to my web server when I have "Redirect from http to https" enabled on my web server. "Enhances the security of website's visitors by setting up a permanent, SEO-safe 301 redirect from the insecure HTTP to the secure HTTPS version of the website."

Hi Matt,

To have your websites using https instead of http, as much as I know (which isn't much) doesn't imply setting the server global setting "Redirect from http to https" enabled.
I think it can be done using rules on the .haccess file of each website.

This way you can allow old Arduinos to connect to your server, and have your webpages served with https.

Regards
Werk_AG
Reply
#3

Thank you for that information, I will give it a try Smile
Reply




Users browsing this thread: 1 Guest(s)