Skip to content

v3.6.0

Compare
Choose a tag to compare
@slaff slaff released this 15 Jun 08:16
· 1055 commits to develop since this release

This is a major release containing fixes, new features and backwards-incompatible changes

Features

  • SmtpClient (#1380)
    A powerful asynchronous smtp client that allows sending emails directly from ESP8266.

    • support for authentication (PLAIN and CRAM-MD5)
    • support for faster transfer via PIPELINING
    • support for attachments ( as much and as big as the remote server allows)
    • support for UTF-8 text encoding
    • support for sending multiple emails using the same TCP connection
    • support for connection over SSL and support for STARTTLS (needs Sming to be compiled with ENABLE_SSL=1 )
  • MqttClient: changing server and port setting can be done in runtime (#1390)

  • Added support for Nextion displays. (#1389)

  • Added open collective badge and information for financial contributions. (#1398)

  • Added support for lambdas in the Timer class (#1378)
    Using C++11 std::function and std::bind

  • Added support for POST params and file upload via POST in the HttpClient. (#1381)

  • Exposed the remote port and ip for the connections. (#1370)

Changes

  • Improvements to the InfraRed libraries (#1318)

    • Added RingBufCPP library from Aaron Wisner
    • Updated IR lib sample
    • Fixed sign problem with JVC send when time elapsed is bigger than JVC_RPT_LENGTH - JVC_MIN_GAP
    • Reduced timer for IR sample application
    • Updated IRremoteESP8266 library to latest version
  • Replaced DHT library with DHTesp. Updated the samples accordingly. (#1341)

  • Improved design for the HttpConnection. (#1386)

    • (Before) By default the HttpConnection was storing all data coming back from the server. Meaning that a response body bigger than 30K will crash for sure the device.
    • (Now) By default the HttpConnection stores the first 1024 bytes. Thus by default the device will not crash with big response body.
      If a developer wants to use the httpclient and store more than 1024 bytes from the response, then he/she can set the response stream to be MemoryStream.
      Ex: request.setResponseStream(new MemoryStream());
  • Refactored the streams (#1377)

    • Moved the streams from SmingCore/Network/Http/Stream to SmingCore/Data/Stream. They will be used also in the coming SmtpClient.
    • Unified the stream transformation code and added it to StreamTransformer.
    • Removed deprecated method name from CircularBuffer.
    • Moved common data structures from HttpCommon.h to SmingCore/Data/Structures.h
    • Moved DataSourceStream, CircularBuffer and OutputStream to SmingCore/Data.
    • Added username and password processing in the URL.
  • Refactored SSL validators (#1379)

    • Allow creating fingerprint chain.
    • Allow multiple fingerprints from the same type to be in the chain. For example public key hash and a backup public key hash for the backup private key.
    • Move the fingerprinting to the TcpClient.
    • Unify the private key / certificate setting for both TcpClient and TcpServer.

Migration from v. 3.5.2 or earlier

Those changes will affect your code ONLY if you use DIRECTLY in your application the following classes.

  • HttpMultipartStream
    * HttpMultipartStream is renamed to MultipartStream
    * SmingCore/Network/Http/Stream/HttpMultipartStream.h is moved to SmingCore/Data/Stream/MultipartStream.h

  • HttpChunkedStream.h
    * HttpChunkedStream is renamed to ChunkedStream
    * SmingCore/Network/Http/Stream/HttpChunkedStream is moved to SmingCore/Data/Stream/ChunkedStream.h

  • DataSourceStream.h and OutputStream.h are now located in SmingCore/Data/Stream/.

    • CircularBuffer.h is moved to SmingCore/Data/.
    • URL - if you use protocol different than HTTP then the default port will be set to 0. In the previous versions the default port was always 80, no matter what the URL protocol was.
  • The deprecated TcpConnection::setSslFingerprint is removed. Use TcpClient::pinCertificate instead.

  • TcpConnection::setSslClientKeyCert is deprecated. Use TcpConnection::setSslKeyCert instead. It can be used on a server to set the server certificate used for encryption, or on a client to set a client certificate used for authentication.

    • All SSL fingerprinting is moved to the TcpClient as it is relevant only for the client SSL connections.
    • Calling multiple times TcpClient::pinCertificate will add multiple SSL validators. This is quite useful if you have one private key, that is currently used on the server, and another backup key, just in case the previous key gets compromised. In that case one can do the following:
    MqttClient mqttClient;
    // ...
    mqttClient.pinCertificate(fingerprintPublicKeyCurrent, eSFT_PkSha256); // first fingeprint
    mqttClient.pinCertificate(fingerprintPublicKeyEmergencyBackup, eSFT_PkSha256); // second fingerprint
    

    In the example above the first fingerprint will be checked. If it is valid no further checks will be done. If the first one fails then the next will be validated. If none of the fingerprints was valid then the connection will be rejected.

Fixes

  • Fixes to the postParams unescaping (#1402)
  • Fixes to the IR Library. (#1373)

All PRs merged in this release can be seen from here

For a complete list of changes run the following command:

git log 3.5.2..3.6.0

Thanks to everyone who helped us make this release happen.