1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

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.
This commit is contained in:
Ivan Grokhotkov
2017-10-08 07:08:51 +08:00
parent 84b046f98c
commit 526f4fbb6c
4 changed files with 63 additions and 37 deletions

View File

@ -62,6 +62,8 @@ public:
bool loadCertificate(Stream& stream, size_t size);
bool loadPrivateKey(Stream& stream, size_t size);
void allowSelfSignedCerts();
template<typename TFile>
bool loadCertificate(TFile& file) {
return loadCertificate(file, file.size());
@ -79,6 +81,7 @@ public:
protected:
void _initSSLContext();
int _connectSSL(const char* hostName);
bool _verifyDN(const char* name);