mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Add warning when no authenticator, drop verify() (#5205)
Print a warning when in debug mode when a BearSSL connection tries to connect without having any defined authentication methods, since it will fail. Completely remove the empty axTLS compatibilty method "::verify(char *fp, char *name)" because it can't be done w/BearSSL w/o user code changes, and always failed. Better to have a compile failure when we know at compile time the app won't do what is expected. Completes the changes started by @d-a-v in PR #4833
This commit is contained in:
committed by
GitHub
parent
18612c97d8
commit
14808c9ac4
@ -883,6 +883,13 @@ bool WiFiClientSecure::_connectSSL(const char* hostName) {
|
||||
_freeSSL();
|
||||
_oom_err = false;
|
||||
|
||||
#ifdef DEBUG_ESP_SSL
|
||||
// BearSSL will reject all connections unless an authentication option is set, warn in DEBUG builds
|
||||
if (!_use_insecure && !_use_fingerprint && !_use_self_signed && !_knownkey && !_certStore && !_ta) {
|
||||
DEBUGV("BSSL: Connection *will* fail, no authentication method is setup");
|
||||
}
|
||||
#endif
|
||||
|
||||
_sc = std::make_shared<br_ssl_client_context>();
|
||||
_eng = &_sc->eng; // Allocation/deallocation taken care of by the _sc shared_ptr
|
||||
_iobuf_in = std::shared_ptr<unsigned char>(new unsigned char[_iobuf_in_size], std::default_delete<unsigned char[]>());
|
||||
|
Reference in New Issue
Block a user