1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

37 Commits

Author SHA1 Message Date
Dirk Mueller
3890e1af1e Put longer string literals into PROGMEM (#6588)
* Put longer string literals into PROGMEM

* Use Flash Strings for Debug output

This is hopefully very infrequently used, so it shouldn't
be in main memory.
2019-10-03 23:17:36 -03:00
Jeroen88
60d519e235 Bugfix/esp8266 http client (#6176) 2019-08-26 16:12:50 +02:00
Allman-astyler
eea9999dc5 Revert "Allman now (#6080)" (#6090)
This reverts commit 98125f88605cd7e46e9be4e1b3ad0600dd5d2b51.
2019-05-14 00:09:54 +02:00
Allman-astyler
98125f8860 Allman now (#6080)
* switch restyle script for CI

* remove confirmation

* restyle with allman
2019-05-13 16:41:34 +02:00
david gauchard
e5b4de3633
fix DEBUG macros (#5728)
* fix DEBUG macros

All fmt strings in flash
fix #5658

This also allows to avoid warnings and easy mistakes with (no brace):
    if (something)
        DEBUGV("blah");

* use newlib unaligned-compatible printf for DEBUGV

* remove useless putprintf since ::printf already uses ets_putc
2019-03-14 11:19:21 +01:00
liebman
e46ccae9d5 optionally allow redirects on HTTPClient & OTA updates (#5009)
* optionally allow redirects on http OTA updates

* Refactored HTTPClient::begin(url...) & setURL functions, now only beginInternal parses URL, sets ports
Added HTTPRedirect example.

* fix indentation for style check

* add space after while for style check

* don't use deprecated begin method in redirect example

* moved redirect handling code to HTTPClient.
only GET and HEAD requests are currently handled automatically
Redirects that fail to be automatically handled return the redirect code as before

* added support for POST/303 redirect
added device redirect tests

* add missing getLocation() implementation

* if the new location is only a path then only update the URI
2019-03-13 01:51:17 +01:00
david gauchard
116da1881c update HTTPCLIENT_1_1_COMPATIBLE (#5389)
* update HTTPCLIENT_1_1_COMPATIBLE: #if instead if #ifdef, set to 1 by default
host emulation updates

* host CI: minor simplification

* revert -j
2018-11-29 10:42:44 -08:00
Earle F. Philhower, III
fcdffc5dfd
Save 2.3K in HTTPClient debug mode by PSTR (#5387)
Convert the HTTPClient debug macro to store strings in PROGMEM and
use the printf_P method to dump them.

Saves ~2.3KB heap when in debug mode.
2018-11-29 06:37:07 -08:00
Jeroen88
13f374666d Add WiFiClient parameter to HTTPClient (#4980)
Make HTTPClient take a WiFiClient parameter, allowing you to pass in a
simple HTTP WiFiClient or a BearSSL or axTLS WiFiClientSecure with
any desired verification options.  Deprecate the older, TLSTraits methods.
Add basic HttpsClient example.

Add optional LED feedback to the Update class
2018-10-06 07:50:03 -07:00
yoursunny
bbaea5a358 ESP8266HTTPClient: allow getString() more than once (#5091)
fixes #4951
2018-09-09 00:34:20 -03:00
Earle F. Philhower, III
e3c970210f
Add BearSSL client and server, support true bidir, lower memory, modern SSL (#4273)
BearSSL (https://www.bearssl.org) is a TLS(SSL) library written by
Thomas Pornin that is optimized for lower-memory embedded systems
like the ESP8266. It supports a wide variety of modern ciphers and
is unique in that it doesn't perform any memory allocations during
operation (which is the unfortunate bane of the current axTLS).

BearSSL is also absolutely focused on security and by default performs
all its security checks on x.509 certificates during the connection
phase (but if you want to be insecure and dangerous, that's possible
too).

While it does support unidirectional SSL buffers, like axTLS,
as implemented the ESP8266 wrappers only support bidirectional
buffers. These bidirectional buffers avoid deadlocks in protocols
which don't have well separated receive and transmit periods.

This patch adds several classes which allow connecting to TLS servers
using this library in almost the same way as axTLS:
BearSSL::WiFiClientSecure - WiFiClient that supports TLS
BearSSL::WiFiServerSecure - WiFiServer supporting TLS and client certs

It also introduces objects for PEM/DER encoded keys and certificates:
BearSSLX509List - x.509 Certificate (list) for general use
BearSSLPrivateKey - RSA or EC private key
BearSSLPublicKey - RSA or EC public key (i.e. from a public website)

Finally, it adds a Certificate Authority store object which lets
BearSSL access a set of trusted CA certificates on SPIFFS to allow it
to verify the identity of any remote site on the Internet, without
requiring RAM except for the single matching certificate.
CertStoreSPIFFSBearSSL - Certificate store utility

Client certificates are supported for the BearSSL::WiFiClientSecure, and
what's more the BearSSL::WiFiServerSecure can also *require* remote clients
to have a trusted certificate signed by a specific CA (or yourself with
self-signing CAs).

Maximum Fragment Length Negotiation probing and usage are supported, but
be aware that most sites on the Internet don't support it yet.  When
available, you can reduce the memory footprint of the SSL client or server
dramatically (i.e. down to 2-8KB vs. the ~22KB required for a full 16K
receive fragment and 512b send fragment).  You can also manually set a
smaller fragment size and guarantee at your protocol level all data will
fit within it.

Examples are included to show the usage of these new features.

axTLS has been moved to its own namespace, "axtls".  A default "using"
clause allows existing apps to run using axTLS without any changes.

The BearSSL::WiFi{client,server}Secure implements the axTLS
client/server API which lets many end user applications take advantage
of BearSSL with few or no changes.

The BearSSL static library used presently is stored at
https://github.com/earlephilhower/bearssl-esp8266 and can be built
using the standard ESP8266 toolchain.
2018-05-14 20:46:47 -07:00
Joe Todd
c9dc8e1717 ESP8266HTTPClient: Add PATCH request (#3590) 2017-09-22 03:52:13 -05:00
Fabian Desoye
3fc3e9a99d Added PUT Request to HTTP Client (#2310)
* Added PUT Request to HTTP Client

* Replaced Tabstops with spaces
2016-07-26 18:23:38 +08:00
Ivan Grokhotkov
dd81336b79 ESP8266HTTPClient: fix duplicate Content-Length headers (#1902) 2016-06-03 16:11:44 +08:00
Ivan Grokhotkov
81d3bb3e3a Return error when HTTPClient::begin is called with HTTPS URL without certificate fingerprint (#1941) 2016-04-22 19:21:57 +08:00
Ivan Grokhotkov
a455f22587 HTTPClient, HTTPUpdate: save some RAM by moving strings into flash 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
bf7f33d918 Fix code formatting 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
cae4039225 HTTPClient: decouple transport layer handling 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
93d57fabe2 Remove overloads of HTTPClient::begin which take const char*
Since the data is stored as Strings internally, these methods do not serve as an optimisation
2016-04-09 12:46:29 +03:00
Markus Sattler
27f1a63170 allow String for payload in HTTPclient sendRequest 2016-01-29 13:19:56 +01:00
Markus Sattler
2b23b005aa allow control of enabling debug and debug level from IDE 2016-01-02 12:25:39 +01:00
Markus Sattler
9b06b889c9 disable HTTP client debug 2015-12-31 17:10:38 +01:00
Markus Sattler
ef748e369a allow downgrade to HTTP 1.0
use HTTP/1.0 for update since the update handler not support any transfer Encoding
2015-12-31 14:02:00 +01:00
Markus Sattler
bd7d915bcd rework error handling and detection
add retry for short write
remove compiler warnings
2015-12-31 12:00:26 +01:00
Markus Sattler
288e879a13 disable debug 2015-12-30 21:21:30 +01:00
Markus Sattler
cc0037682b add CHUNKED encoding support too http client (#1324)
HTTP Client - fix examples
increase default timeout to 5000ms
2015-12-30 21:20:43 +01:00
Denver Abrey
d1a6b32133 Allow setting TCP timeout 2015-12-27 19:45:17 +02:00
Markus Sattler
28dd31a80f add advanced error handling for HTTP update
see: #1111
2015-12-16 23:05:23 +01:00
Markus Sattler
b8769bf5eb HTTP Client move buffer (1460 Byte) from stack to heap. 2015-12-16 00:36:11 +01:00
Markus Sattler
85341ff25a HTTPClient phasing username + password from url 2015-12-09 14:19:28 +01:00
Markus Sattler
a9ce1b4f2e add Authorization support for HTTP client 2015-12-09 13:51:55 +01:00
Markus Sattler
b1e3d2256a add errorToString function 2015-12-09 13:05:29 +01:00
Markus Sattler
e15c745e6f remove some HTTP_CODE_UNASSIGNED 2015-12-09 12:50:55 +01:00
Markus Sattler
8b161ecf16 add http codes as enum t_http_codes 2015-12-09 12:47:23 +01:00
Ivan Grokhotkov
c10a19e052 ESP8266HTTPClient: fix HTTPCLIENT_TCP_TIMEOUT definition 2015-11-30 10:15:59 +03:00
Ivan Grokhotkov
1c616747ab ESP8266HTTPClient: fix case for some defines 2015-11-30 10:07:38 +03:00
Ivan Grokhotkov
ea7eade8f1 Rename ESP8266httpClient to ESP8266HTTPClient (part 2) 2015-11-30 09:49:40 +03:00