arduino-libraries / ArduinoHttpClient

Arduino HTTP Client library
288 stars 172 forks source link

sendInitialHeaders breaks session #137

Open purplehorace opened 2 years ago

purplehorace commented 2 years ago

We have been trying to test a connection with our server to POST some data.

We are using https so initialising the library with using WiFISecureClient and ssl cert and setting port to 443 as you would expect for https.

The connection has been failing consistently and digging into the source to find the issue we have discovered that the check:

           if (iServerPort != kHttpPort)
           {
              iClient->print(":");
              iClient->print(iServerPort);
           }

causes the port to be appended to tje Host header. Control needs to be added to be able to suppress this as it can cause issues with some proxy setups. Or facility needs to be added to initialise kHttpPort so it can match the iServerPort.