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

395 Commits

Author SHA1 Message Date
Ivan Grokhotkov
fac64900dd Configurable WiFiClientSecure connect timeout, better default value (#4027)
* WiFiClientSecure: use _timeout setting when connecting

This timeout value can be customized via a call to setTimeout function.

Closes https://github.com/esp8266/Arduino/issues/3944.

* WiFiClientSecure: increase default connection timeout to 15 sec
2017-12-26 14:01:28 -03:00
Ivan Grokhotkov
ddda374985 WiFiClientSecure: don't trash unread decrypted data when writing (#4024)
* WiFiClientSecure: don't decrypt when testing for 'connected'

* WiFiClientSecure: don't trash unread decrypted data when writing

When application requests to write data, check if there is any unread
decrypted data left. If there is, don't write immediately, but save the
data to be written. When all decrypted data has been consumed by the
application, send out the saved outgoing data.

Fixes https://github.com/esp8266/Arduino/issues/2256.
2017-12-26 11:28:18 -03:00
david gauchard
d5bb4a99f6 in example properly wait for NTP to be set (#4000)
fix #3905
2017-12-21 16:27:58 -03:00
david gauchard
022ea5a872 consequence of ::flush() update: fix potential double free (#3990) 2017-12-18 08:56:18 -03:00
david gauchard
f8b577b6c3 fix WiFiClient::availableForWrite() with no connexion (#3985)
fix #3983
2017-12-18 00:47:56 -03:00
david gauchard
26980b39e3 fix #1002 ::Flush() wait for empty send buffer (#3967)
* fix #1002 ::Flush() wait for empty send buffer

* WiFiClient::Flush() guarantees that the data has been delivered
option 1 of https://github.com/esp8266/Arduino/pull/3967#discussion_r156901071
10ms max wait according to loaded tcp echo/reply scheme
2017-12-17 13:16:41 -03:00
Develo
7df2858285
Fix comment misnomer (#3939) 2017-12-08 15:58:46 -03:00
Rotzbua
31abb6e5e1 [doc] update HTTPSRequest.ino (#3925)
add limitations of https connections
2017-12-08 03:38:19 -03:00
Shawn A
7b09ae5f69 Bug #3795 (#3858)
* fixes #3795

* adds beacon_interval and authmode to softap_config_equal
2017-11-22 19:01:22 -03:00
Shawn A
c40d8a990e adds WiFi.getPersistent() (#3857) 2017-11-22 18:08:28 -03:00
Develo
9dcc580aef
Add compatibility check for ::config() method with arduino arg order (#3860) 2017-11-22 10:22:11 -03:00
Develo
2f09ea7117
refactor of WiFiMulti::run to reduce complexity and remove dead code (#3847) 2017-11-20 21:46:12 -03:00
Shawn A
78b0f44348 fixes #3795 (#3796)
don't ignore ret when handling AP enable/disable in softAPdisconnect
2017-11-17 20:28:34 -03:00
Shawn A
397592fce7 fixes #3793 (#3794)
wifi_softap_set_config always fails, password cannot be 0 unless authmode is open, no documentation found, trial and error.
2017-11-17 15:20:40 -03:00
James Stanley
2abbc36da4 Put WiFi into station mode in examples (#3731) 2017-10-22 13:53:01 +08:00
Ivan Grokhotkov
c83e17b31e WiFiUpd: fix warning 2017-10-15 14:41:50 +08:00
Ivan Grokhotkov
5116a46f09 WiFiClient,WiFiServer: update to match new err_t definition 2017-10-15 01:40:10 -05:00
Ivan Grokhotkov
e04903225e sdk: update to v2.1.0-10-g509eae8 2017-10-15 01:40:10 -05:00
Ivan Grokhotkov
2c2d6a3bad Don't remove persistent WiFi settings when doing scan (#2946) 2017-10-13 02:27:10 +08:00
Ivan Grokhotkov
526f4fbb6c WiFiClientSecure: add option to allow self-signed certificates
Mainly useful for testing WiFiClientSecure in local environments.

If allowSelfSignedCerts is called before verifyCertChain, then the
certificate chain will be verified, but the final certificate may be
self-signed.
2017-10-08 07:08:51 +08:00
Ivan Grokhotkov
84b046f98c WiFiClientSecure: add support for keys and certificates in PROGMEM 2017-10-08 05:04:04 +08:00
Ivan Grokhotkov
507a15910e WiFiClientSecure: display certificates when debugging is enabled 2017-10-02 00:27:22 +08:00
Ivan Grokhotkov
eb891cd6e4 Revert "Added support for user-supplied DHCP range, with basic sanity checks (#3562)"
This reverts commit bdf2296a7d521ec876f15f3491b6690fff6abbb7.
2017-09-26 04:31:45 +08:00
Matthew Blythe
13c1e8b293 UdpContext: check that pbuf_alloc doesn't return nullptr (#3354) 2017-09-22 03:56:27 -05:00
NdK
bdf2296a7d Added support for user-supplied DHCP range, with basic sanity checks (#3562) 2017-09-21 03:52:30 -05:00
cheng3100
41a8fdb4a9 Add the ESP8266WiFiMulti to KEYWORD1 to make it highlight in the ino file (#3624) 2017-09-20 22:17:09 -05:00
rudivandrunen
2d3b7b9759 WiFiClientSecure: add loadCACert function (#3610)
Added loadCACert function
2017-09-19 22:49:38 -05:00
Earle F. Philhower, III
8f04be4c5b Remove unused ax_port_*alloc() functions (#3482)
The ax_port_malloc, ax_port_calloc, ax_port_realloc, and ax_port_free
functions in WiFiClientSecure are not actually used by the AXTLS library.
It's directly using the library routines, and these function are never
used.  Remove these dead bits of code to make the axtls operation clearer.
2017-08-01 18:38:35 +03:00
Ivan Grokhotkov
8c3bb69530 WiFiClientSecure: don’t send close alert when opening new session
When WiFiClientSecure::connect was called, it would first tear down and
existing and set up new TCP session, then tear down existing TLS session
(using ssl_free), and then set up a new one. This caused TLS close-
notify alert to be sent to the new TCP session, preventing new session
from being established. This change postpones setting IO ctx to the new
TCP connection, fixing this issue.

Ref https://github.com/esp8266/Arduino/issues/3330
2017-06-05 17:30:57 +08:00
Ivan Grokhotkov
d6f1f0d5d7 WiFiClient: apply write timeout to single chunk (#3273)
WiFiClient write timeouts introduced in #3257 applied to the whole write
operation, which could take long time if data size was large. This
change makes the timeout happen per chunk. Timeout now happens if no
data has been delivered within a given interval.
2017-05-22 20:08:16 +08:00
Ivan Grokhotkov
f6d232f1ac WiFiClientSecure: match CN and SANs ignoring case
Some websites have certificates with uppercase letters in CN. This change
makes _verifyDN function accept such certificates by converting all names
to lower case before comparing them.

Resolves #2978
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
a8e8ecb687 WiFiClientSecure: add example of setCACert/verifyCertChain
Ref #1851
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
79cfad5d46 WiFiClientSecure: initialize ssl_ctx when loading certificate
Fixes #2470
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
4812cae8e2 WiFiClient: initialize _timeout properly 2017-05-20 12:20:03 +08:00
Ivan Grokhotkov
684b5f1629 WiFiClient: set default timeout to 5000ms for compatibility 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
71512653ca WiFiClient: use Stream::_timeout for write operations 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
eebcc656ed WiFiClient: add support for connect timeout 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
2aeac91c90 ESP8266WiFi: support timeout for WiFi.hostByName 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
7de81270a3 ClientContext: don’t read DataSource in TCP callback
Previously, _write_some function would be called each time TCP stack
notifies the application that some data was delivered (via the `sent`
callback). In turn, _write_some would obtain more data to be sent from
the DataSource. In case of a DataSource backed by a Stream, this would
read from a stream. Some libraries (such as SD) may call `yield` and
other blocking operations from Stream read function, which can not be
used in TCP stack callbacks.

This change moves the data sending loop back into the Arduino task, with
a negligible loss of performance. TCP callback now wakes the main task
via `esp_schedule`, which performs stream read and provides more data
to the TCP stack.

Possible future optimization would be to buffer Stream data ahead of
time. That way, buffered data could be sent immediately from the TCP
callback. On the other hand, this optimization would need extra TCP_MSS
of temporary storage, per connection.

Fixes #2399.
2017-05-09 06:17:32 -05:00
Trygve Laugstøl
2d9e767630 Fixing a few compiler warnings to allow compilation with -Wall -Wextra and -Werror. (#3153) 2017-05-08 04:56:08 -05:00
Ivan Grokhotkov
c5c138ec5a axtls: update to bddda2a0
- update ssl_client_new signature
- add max fragment length negotiation support (hardcoded to 4096 bytes)
- build axtls with -f{function,data}-sections, ~1k less DRAM usage,
  ~3k less flash
- strip prefix from build paths in debug symbols
2017-04-29 22:58:19 +08:00
david gauchard
a41f55c469 prepare lwip2 (#3129)
* minimum changes for libraries to compile with lwip2

* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
2017-04-25 08:55:01 -05:00
Ivan Grokhotkov
93413efcf4 Remove queue.h contents originating from BSD (#2982)
fixes #2981
2017-02-19 05:36:30 +03:00
Frank Sautter
af58a74cc0 Allow usage of byte arrays to set RootCAs (#2968) 2017-02-15 14:22:23 +03:00
wosk
e9dea9af99 Update keywords.txt for coloring syntax (#2892)
Add ESP keywords and update ESP8266Wifi library
2017-02-06 13:25:27 +03:00
Ivan Grokhotkov
808bf50ff2 wifi: add SoftAPModeProbeRequestReceived event handler (#2917)
- add probe request event handler (#2910)
- update WiFi events handling example to use new handler

Pro tip: replace blinking LED with ‘analogWrite’ and connect the pin to
a loudspeaker (or use a servo to hit a bell). Get notified when someone
with a smartphone wanders around your country house.
2017-02-06 13:24:34 +03:00
joelucid
61787b23af ClientConnection uses too much heap when streaming files #2871 (#2874)
* ClientConnection uses too much heap when streaming files #2871

* make write_chunk_size a member variable

* untabify
2017-01-31 11:04:45 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
WereCatf
d46d742db1 Use WIFI_STA in WiFiClient-examples
Many people have problems with using ESP8266 as WiFi-client due to
none of the examples mentioning that you should use WIFI_STA if you
only want the ESP8266 to act as a WiFi-client. Many WiFi-devices
will randomly try to connect to the ESP8266 if used as STA+AP and
complain about not being able to access the Internet or other devices
on the network.
2016-10-29 12:40:06 +03:00
Ivan Grokhotkov
b41266097f WiFiClientSecure: certificate loading refactoring, support for CA root cert verification 2016-08-25 13:01:10 +08:00