Commit Graph

29 Commits

Author SHA1 Message Date
me-no-dev
6f23cd5988 Make sure that HTTPClient disconnects from the old server if redirecting to new one
Fixes: https://github.com/espressif/arduino-esp32/issues/4763
2021-02-04 02:42:44 +02:00
Me No Dev
ef99cd7fe7
Add WiFiClientSecure::setInsecure() to equalize API with ESP8266 (#4648) 2020-12-21 01:09:37 +02:00
Frank
3968821834
HttpClient uses Serial.printf() (#4488)
changed to log_d()
2020-11-04 14:49:33 +02:00
Frank
90f869e772
Fix BUG: Parsing of first line fails (#4484)
..because a firstLine = false; is missing ;)
2020-11-04 02:24:01 +02:00
Me No Dev
704b71dabe
Fix header parsing
fixes #4454

closes #4455
2020-11-02 20:10:22 +02:00
Dan Oprescu
ee3bb16c77
Fix support for following redirects added by ee88c42c3b (#4240) (#4385) 2020-10-14 14:32:47 +03:00
wadim
aa529eb5a0
Fix getString() freeze on empty responses (#4317) 2020-10-01 15:36:23 +03:00
Clickau
ee88c42c3b
Add support for following redirects in HTTPClient (#4240) 2020-10-01 14:41:54 +03:00
kliment
7a92f89d12
Set TLS cert options before calling connect on client, so verify works (#3774)
When connecting using transportTraits, the CA and client certificates are ignored after the initial _client->connect() is called. This is because on connect, WiFiClientSecure will call start_ssl_client with _CA_Cert and other cert options set to null unless setCACert, setCertificate etc. are called before connect. Running _transportTraits->verify after connect therefore does exactly nothing. It's easy to verify that this is the case by passing a CACert to HTTPClient with verbose logging enabled - the logs will say "WARNING: Use certificates for a more secure communication!" which is only present when both PSK and CA are null. This change fixes the issue.
2020-09-30 14:41:03 +03:00
Jeroen88
7de1717640 Fix replacing of headers with overlapping names. Fixes issue #3483 (#3487)
If two headers with overlapping names are added while replace == true, like in:
```cpp
http.addHeader("api_token",  "pMXFOLpinQqajaRQJYMeWObg2XYmcX1");
http.addHeader("token", "1234");
```
then replacing went wrong. This is fixed with this PR.
2020-01-20 15:27:51 +02:00
Marcel Stör
07613b3158 Update URL to point to upstream repository (#3187)
Pointing to an old fork is misleading.
2019-09-08 23:15:46 +03:00
Jeroen88
f4acac4c2b Bugfix/http client (#2867)
* Fix persistance issue found, see ESP8266 issue #6152

* Correcting the parsing of the header for HTTP1.0

* Send 'Connection: Close' header in case of HTTP1.0

* Let reuse connection depend on protocol used: HTTP1.0 or HTTP1.1

* Fixed reuse, added null ptr checks, added check for _trainsportTraits in connect() in case _client was set null

* Fix reuse connection issues, similar to ESP8266 PR #6176
2019-08-20 17:18:09 +03:00
Jeroen88
7d7824701f Fix persistance issue found, see ESP8266 issue #6152 (#2851) 2019-06-05 14:00:00 +02:00
Matthias Budde
92220b7643 Added PATCH request. (#2610) 2019-04-09 21:22:47 +02:00
boarchuz
dd649808d1 Add server connect timeout to HTTPClient (#2606) 2019-04-09 21:19:25 +02:00
atanisoft
0de0d3f79a move call to setTimeout() to after the client connects. (#2214)
This is necessary to avoid this log entry from being generated due to invalid usage of setTimeout:
[E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
2018-12-18 19:21:36 +01:00
Jeroen88
0640964879 Solve issue #2092 by initializing * _client to nullptr (#2097) 2018-11-26 23:23:19 +01:00
Martin
273196d7e6 HTTPClientEnterprise example (#2023) 2018-11-19 17:02:47 +01:00
FotoFieber
7b811f9b3a leave possible endless loop (#1986) 2018-11-19 16:59:14 +01:00
Jeroen88
01d22c8807 Feature/http client (#1973)
* Pass client parameter into two new begin() functions. Set other begin() functions deprecated. Updated library version to 1.2

* Added working HTTPS example on a public url with a certificate

* Remove two unnecessary tests in ::disconnect()

* Add a scoping block to BasicHttpsClient.ino to assure HTTPClient is destroyed before WiFiClientSecure

* Added check to handle mixup of old and present api properly

* Correct HTTPClient::setTimeout() to convert milliseconds to seconds. Correct WiFiClient::setTimeout() to call Stream::setTimeout() with seconds converted back to milliseconds. Remove inproper checks for _insecure.

* Added small comment because it looked like the Travis build did not finish
2018-11-19 16:57:23 +01:00
me-no-dev
ff90778173 Fix HTTP client returning disconnected when there is still data avalable 2018-07-10 21:06:20 +02:00
h3ndrik
e3a5ae439b clean up faster (fixes #828) (#1087)
flush tcp buffer instead of reading it byte by byte.
2018-03-04 20:53:04 +01:00
Jason K
cfbb7300b7 Update to make use of SSL a bit less confusing by ensuring errors are generated if the wrong method is called to retrieve the data stream. (#934) 2017-12-19 14:06:45 +01:00
copercini
8ba91b9453 Feed WDT (#817)
fix for https://github.com/espressif/arduino-esp32/issues/740
2017-11-06 20:17:10 +02:00
Andreas Pokorny
36dba996c1 Extend HTTPClient to allow connecting with a client certificate (#788)
* Forward client certificate to wificlient secure

* remove comment
2017-10-30 09:37:33 +01:00
me-no-dev
e72895b722 Quiet SSL and HTTPClient debug 2017-09-29 20:31:45 +08:00
me-no-dev
7aa1913506 Allow HTTPS without certificate to use begin(url) 2017-09-29 17:02:59 +08:00
me-no-dev
4230aeca83 Allow HTTPClient to access HTTPS without providing a certificate 2017-09-28 20:19:23 +08:00
copercini
51a4432ca8 HTTPClient Port (#347)
* Fix possible infinite loop in the example

* Remove workaround of sockets always return -76 

Remove workaround of sockets always return -76 (because it's fixed on IDF now)
Remove delay during handshake (improving stability)

* Remove unusable mbedtls_net of context creation

* Fix bad destructor

* Compatibility with WiFiClient for HTTPClient

* Initial port from ESP8266

Changed SHA1 fingerprint by Root CA verification
Changed log system

* Remove deprecated function
2017-05-19 10:18:20 +02:00