WiFiClientSecure::lastError() method (#945)

* Added a lastError method to WiFiClientSecure so that a connection error from mbedTLS can be retrieved if connection fails (and then presented to a user).

* Changed to dos CRLF

* Made buffer size a const\nMore cleanup to match source
This commit is contained in:
lbernstone
2018-01-17 16:03:56 -07:00
committed by Me No Dev
parent 81e0250983
commit d650ac6c3c
2 changed files with 14 additions and 2 deletions

View File

@ -29,7 +29,8 @@ class WiFiClientSecure : public WiFiClient
{
protected:
sslclient_context *sslclient;
int _lastError = 0;
const char *_CA_cert;
const char *_cert;
const char *_private_key;
@ -55,7 +56,7 @@ public:
void flush() {}
void stop();
uint8_t connected();
int lastError(char *buf, const size_t size);
void setCACert(const char *rootCA);
void setCertificate(const char *client_ca);
void setPrivateKey (const char *private_key);