1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-20 05:03:14 +03:00

WiFiClientSecure: certificate loading refactoring, support for CA root cert verification

This commit is contained in:
Ivan Grokhotkov
2016-08-25 13:01:10 +08:00
parent 7f6e0c98f6
commit b41266097f
2 changed files with 195 additions and 132 deletions

View File

@@ -39,6 +39,7 @@ public:
int connect(const char* name, uint16_t port) override;
bool verify(const char* fingerprint, const char* domain_name);
bool verifyCertChain(const char* domain_name);
uint8_t connected() override;
size_t write(const uint8_t *buf, size_t size) override;
@@ -54,6 +55,7 @@ public:
bool loadCertificate(Stream& stream, size_t size);
bool loadPrivateKey(Stream& stream, size_t size);
bool loadCACert(Stream& stream, size_t size);
template<typename TFile>
bool loadCertificate(TFile& file) {
@@ -67,6 +69,7 @@ public:
protected:
int _connectSSL(const char* hostName);
bool _verifyDN(const char* name);
SSLContext* _ssl = nullptr;
};