aws / amazon-freertos

DEPRECATED - See README.md
https://aws.amazon.com/freertos/
MIT License
2.54k stars 1.1k forks source link

[BUG] Wrong header when using c_sdk https client #3496

Closed Froopas closed 2 years ago

Froopas commented 2 years ago

Hello,

I am trying to connect to a http server using the c_sdk http client using IP. The request goes through but I get the response "400 bad request". Requests by other means such as postman works.

I have used wireshark in order to see the requests and notable difference between the requests that work and the ones that doesn't is that the working one has the header "Host::" whilst the ones that doesn't work (when using c_sdk client) have the header "Host:".

If I try to change the address in the request it fails to send at all.

Is there a way to add the port to the header that I have missed?

Kind regards Froopas

archigup commented 2 years ago

Hi, which source and version are you using for the http client? Additionally, that library has been replaced by coreHTTP; perhaps coreHTTP might better meet your needs.

Froopas commented 2 years ago

Hello, The version is v1.1.2. I am taking over a project which is already connected to an AWS instance using mqtt and I am now supposed to extend the capabilities of the embedded system to include http/https requests. The original project is a copy of the freertos repo: https://github.com/Infineon/pred-main-xmc4700-kit

I was looking to move over to coreHTTP but it did not look like it was compatible with the use of the IoT network manager used in the current project.

Froopas commented 2 years ago

I have realized I looked at the wrong repository when looking at coreHTTP implementation. After using the implementation from this repository everything works.