It appears that the configurations for `ck_out_edge` were inverted for `SPI_MODE2` and `SPI_MODE3`. You can check the technical reference manual on page 76, table 23 "Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Master".
I've check with my oscilloscope that the current configuration is wrong and this fix corrects the issue.
* Support self signed certificates
Fix for https://github.com/espressif/arduino-esp32/issues/265
mbedtls_ssl_conf_authmode was defined before mbedtls_ssl_config_defaults causing several bugs when no CA certificate is defined.
* Implement Arduino's log facility
Replace printf by ESP log handling
* Remove \n from debug messages
log_ doesn't need \n to break line.
Actually WiFiMulti is not working due some functions haven't equal comportment of ESP8266
Replace status == WL_DISCONNECTED => status != WL_CONNECTED
Replace scanComplete() => scanNetworks()
Maybe is more interesting, for keep the maximum compatibility, investigate why WL_DISCONNECTED and scanComplete() doesn't works in this case instead of just replace by this pull request.
* Add CA certificate in example
SHA1 fingerprint is broken now: more info: https://shattered.io
* Best error handling
When occur an error in WiFiClientSecure library just return the error message
and clean the context avoiding crash - fix for https://github.com/espressif/arduino-esp32/issues/211
Translate MbedTLS error codes in messages for best understanding
* Declarate certificates as const
mbedtls_pk_parse_key needs a const unsigned char * certificate. In old implementation the certificate was declarated as char * so first it converts to unsigned and after to const.
When we convert signed to unsigned it may result in a +1 larger output.
Fix issue https://github.com/espressif/arduino-esp32/issues/223
* Rework WiFiClient
Rework WiFiClient to correct error where making a copy of a WiFiClient object resulted in the socket being closed prematurely.
Added loop and select to write to handle/prevent EAGAIN errors.
* Rework WiFiClient to use shared_ptr
Rework changes to utilize shared_ptr rather than manually maintaining reference count.
Revert changes to write
* Incorporate comments from review
Move WiFiClientSocketHandle and fd() into WiFiClient.cpp