Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClient: SSL adjustments #2173

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions samples/HttpClient/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ int onDownload(HttpConnection& connection, bool success)

void sslRequestInit(Ssl::Session& session, HttpRequest& request)
{
// Go with maximum buffer sizes
session.maxBufferSize = Ssl::MaxBufferSize::K16;

/**
* If there is not enough RAM and the response from the server is not a big one
* you may prefer to set the size to a lower value. One useful value would be 4K
*
* session.maxBufferSize = Ssl::MaxBufferSize::K4;
*
* Unfortunately most of the servers may ignore this plea from
* our HTTP client and send big SSL packet.
*/

/*
* SSL validation: We check the remote server certificate against a fingerprint
* Note that fingerprints _may_ change, in which case these need to be updated.
Expand Down
3 changes: 2 additions & 1 deletion samples/HttpClient/component.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## size of the flash chip
SPI_SIZE ?= 4M

ENABLE_SSL = 1
## Prefer BearSSL as it can handle more gracefully big SSL packets.
ENABLE_SSL ?= Bearssl