circuitpython/ports/espressif/common-hal
Jeff Epler c98174eea5
Add support for SSL client certificate (load_cert_chain)
Tested with badssl.com:

 1. Get client certificates from https://badssl.com/download/
 2. Convert public portion with `openssl x509 -in badssl.com-client.pem -out CIRCUITPY/cert.pem`
 3. Convert private portion with `openssl rsa -in badssl.com-client.pem -out CIRCUITPY/privkey.pem` and the password `badssl.com`
 4. Put wifi settings in CIRCUITPY/.env
 5. Run the below Python script:

```py
import os
import wifi
import socketpool
import ssl
import adafruit_requests

TEXT_URL = "https://client.badssl.com/"
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))

pool = socketpool.SocketPool(wifi.radio)
context = ssl.create_default_context()
requests = adafruit_requests.Session(pool, context)

print(f"Fetching from {TEXT_URL} without certificate (should fail)")
response = requests.get(TEXT_URL)
print(f"{response.status_code=}, should be 400 Bad Request")
input("hit enter to continue\r")

print("Loading client certificate")
context.load_cert_chain("/cert.pem", "privkey.pem")
requests = adafruit_requests.Session(pool, context)

print(f"Fetching from {TEXT_URL} with certificate (should succeed)")
response = requests.get(TEXT_URL)
print(f"{response.status_code=}, should be 200 OK")
```
2022-10-10 15:10:53 -05:00
..
_bleio ringbuf cleanup 2022-09-21 10:03:05 -04:00
alarm Espressif: do not hold pins during deep sleep if not necessary 2022-09-29 20:11:48 -04:00
analogio make translate and pre-commit formatting fixes 2022-07-08 16:53:53 -04:00
audiobusio Conditionalize LTO 2022-05-27 12:59:54 -07:00
board Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
busio Thonny causing crash emitglue.c:199: 2022-07-06 23:01:19 -04:00
canio wip; compiles 2022-06-26 21:22:22 -04:00
countio Merge pull request #6463 from adafruit/7.3.x 2022-06-06 11:58:05 -07:00
digitalio cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00
dualbank rename left over esp32s2 to espressif 2021-09-18 19:42:18 +05:30
esp32_camera lock and unlock i2c bus around any ops that might access it 2022-09-22 17:03:05 -05:00
espidf Add ability to reserve psram 2022-08-03 16:19:40 -05:00
frequencyio wip; compiles 2022-06-26 21:22:22 -04:00
hashlib WIP websocket to serial 2022-07-01 16:57:10 -07:00
i2ctarget switch back one I2C message 2022-08-10 12:06:43 -04:00
imagecapture message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
mdns Allow for dynamic reconfigure including port 2022-07-15 16:33:12 -07:00
microcontroller Espressif: do not hold pins during deep sleep if not necessary 2022-09-29 20:11:48 -04:00
neopixel_write test and adjust NeoPixel timings on multiple products 2022-04-25 23:12:24 -04:00
nvm Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
os Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
paralleldisplay Update ports/espressif/common-hal/paralleldisplay/ParallelBus.h 2022-03-05 21:48:00 +01:00
ps2io Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
pulseio message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
pwmio fix logic in pwmout_reset() 2022-09-12 17:03:45 -04:00
rgbmatrix Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
rotaryio Espressif: fix allocation of multiple Incremental Encoders 2022-05-24 22:37:24 -04:00
rtc message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
socketpool Improve web workflow responsiveness 2022-07-26 15:29:49 -07:00
ssl Add support for SSL client certificate (load_cert_chain) 2022-10-10 15:10:53 -05:00
supervisor rename left over esp32s2 to espressif 2021-09-18 19:42:18 +05:30
time Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
touchio Fix ESP32 touch; rework common code a bit 2022-08-16 20:04:27 -04:00
watchdog Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
wifi update esp-idf; allow start/stop channels in wifi scanning 2022-10-07 15:29:09 -04:00