vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.94k stars 717 forks source link

HttpsClient example '400 Bad Request' #440

Open Conwon99 opened 3 years ago

Conwon99 commented 3 years ago

What are you working with?

Development Kit: ESP32-Wrover-Kit Kit version; v1.3 Module or chip used: ESP32-WROVER-B Modem: SIM800L TinyGSM version: Don't know how to check (Must be latest)

Code: https://gist.github.com/Conwon99/bdd4a094342adee5c54443412a757a44

Scenario, steps to reproduce

I'm fundamentally attempting to get https to work with TinyGSM - i'm using the HttpsClient example which uses a GET request to retrieve the TINYGSM logo. I connect to the server fine but I get the 400 bad request response. This would lead me to believe it is a formatting error but i'm using the example code so I don't know whats going on. I am able to get the logo using the HTTPClient example which means theres something wrong with https specifically, but I don't know what. Any help would be really appreciated!

Debug and AT command log

IP5306 KeepOn OK Initializing modem... Connecting to APN: orangeinternet OK Connecting to vsh.pp.ua OK Performing HTTP GET request... Response status code: 400 Response Headers: Server : nginx/1.10.3 (Ubuntu) Date : Tue, 08 Sep 2020 11:26:24 GMT Content-Type : text/html Content-Length : 280 Connection : close Content length is: 280 Response:

400 The plain HTTP request was sent to HTTPS port

400 Bad Request

The plain HTTP request was sent to HTTPS port

nginx/1.10.3 (Ubuntu)

Body length is: 280 Server disconnected

SRGDamia1 commented 3 years ago

Sorry this is late, but the SIM800's SSL functionality is pretty hit-or-miss.