Cert bundle code in lib/mbedtls_config was being used, and assumed the older ESP-IDF internal
bundle format, which was changed in ESP-IDF v5.4. Added a wrapper around the ESP-IDF
bundle routines, and stopped using the shared bundle code.
Also fixed extraneous blank lines in mbedtls logging and removed an extraneous, unused, damaged .h.
These protocol operations should not raise exceptions, but sometimes
they do. Catch the exception and extract the errno value if available.
At the same time, harmonize the argument types for the underlying C
routines
In principle this allows core SSL code to be used with e.g., wiznet
or airlift sockets. It might actually be useful with wiznet ethernet devices
(it's probably not with airlift)
Incorrect error handling in send/recv would raise an OSError with
an incorrect (negative) code.
It's likely that this bug was always happening in the Pico W
implementation, which became the basis of the current shared
implementation.
Push handling of WANT_{READ,WRITE} down into mbedtls_raise_error
and use it in recv_into and send.
Tested by connecting to google.com:443, sending nothing, and trying
to read a byte:
```py
import socketpool, ssl, time, wifi
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.SSLContext()
with ctx.wrap_socket(socket.socket()) as ss:
ss.connect(("google.com", 443))
ss.settimeout(1)
b = bytearray(1)
try:
t0 = time.monotonic()
ss.recv_into(b)
except Exception as ee:
t1 = time.monotonic()
exc = ee
print(t1-t0)
raise exc
```
As desired, an exception `OSError: [Errno 116] ETIMEDOUT` occurred
and the time delta value was 1.0 seconds.
(tested on pycamera)
Closes: #8988
the mbedtls version is a bit different so there are some new #ifdefs
needed.
Tested with the ssl test from https://github.com/adafruit/circuitpython/issues/8910
on Adafruit MatrixPortal S3 (no pico w testing done)