Skip to content

Commit

Permalink
Updated and documented esp32 secure behvior after discussion in issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gilmaimon committed Jul 13, 2019
1 parent 80e5fcd commit 5f82069
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ client.setFingerprint(ssl_fingerprint);
```

### ESP32
With the esp32 there is only one option, `ArduinoWebsockets` supports validating the certificate chain by providing the `SSL Certificate` for the server's CA, for example:
With the esp32 you could either provide the full certificate, or provide no certificate. An example for setting CA Certificate:
```c++
const char ssl_ca_cert[] PROGMEM = \
"-----BEGIN CERTIFICATE-----\n" \
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ArduinoWebsockets
version=0.4.5
version=0.4.6
author=Gil Maimon <[email protected]>
maintainer=Gil Maimon <[email protected]>
sentence=A library for writing modern Websockets applications with Arduino.
Expand Down
2 changes: 1 addition & 1 deletion src/tiny_websockets/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ namespace websockets {
_endpoint.setUseMasking(useMasking);
}

void setInsecure();
#ifdef ESP8266
void setFingerprint(const char* fingerprint);
void setInsecure();
#elif defined(ESP32)
void setCACert(const char* ca_cert);
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/websockets_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,11 @@ namespace websockets {
#elif defined(ESP32)
void WebsocketsClient::setCACert(const char* ca_cert) {
this->_optional_ssl_ca_cert = ca_cert;
}
}

void WebsocketsClient::setInsecure() {
this->_optional_ssl_ca_cert = nullptr;
}
#endif

WebsocketsClient::~WebsocketsClient() {
Expand Down

0 comments on commit 5f82069

Please sign in to comment.