circuitpython/shared-bindings
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
..
__future__ add annotations to __future__; don't generate __future__ stubs 2022-03-10 11:19:35 -05:00
_bleio Tweak black_bindings 2022-09-30 11:18:13 -05:00
_eve Tweak black_bindings 2022-09-30 11:18:13 -05:00
_pew Tweak black_bindings 2022-09-30 11:18:13 -05:00
_stage Tweak black_bindings 2022-09-30 11:18:13 -05:00
adafruit_bus_device Tweak black_bindings 2022-09-30 11:18:13 -05:00
adafruit_pixelbuf Tweak black_bindings 2022-09-30 11:18:13 -05:00
aesio Tweak black_bindings 2022-09-30 11:18:13 -05:00
alarm Merge pull request #6962 from dhalbert/espressif-deep-sleep-hold-pins 2022-09-30 22:20:44 -04:00
analogbufio Tweak black_bindings 2022-09-30 11:18:13 -05:00
analogio add missing native modules to support matrix 2022-10-04 19:22:18 -04:00
atexit Tweak black_bindings 2022-09-30 11:18:13 -05:00
audiobusio Tweak black_bindings 2022-09-30 11:18:13 -05:00
audiocore Tweak black_bindings 2022-09-30 11:18:13 -05:00
audioio Tweak black_bindings 2022-09-30 11:18:13 -05:00
audiomixer Tweak black_bindings 2022-09-30 11:18:13 -05:00
audiomp3 Tweak black_bindings 2022-09-30 11:18:13 -05:00
audiopwmio Tweak black_bindings 2022-09-30 11:18:13 -05:00
bitbangio Tweak black_bindings 2022-09-30 11:18:13 -05:00
bitmaptools Tweak black_bindings 2022-09-30 11:18:13 -05:00
bitops Tweak black_bindings 2022-09-30 11:18:13 -05:00
board Tweak black_bindings 2022-09-30 11:18:13 -05:00
busio Tweak black_bindings 2022-09-30 11:18:13 -05:00
camera Tweak black_bindings 2022-09-30 11:18:13 -05:00
canio Tweak black_bindings 2022-09-30 11:18:13 -05:00
countio Tweak black_bindings 2022-09-30 11:18:13 -05:00
digitalio Tweak black_bindings 2022-09-30 11:18:13 -05:00
displayio Tweak black_bindings 2022-09-30 11:18:13 -05:00
dotenv fix some dotenv parsing 2022-10-03 21:56:11 -04:00
dualbank Tweak black_bindings 2022-09-30 11:18:13 -05:00
floppyio Tweak black_bindings 2022-09-30 11:18:13 -05:00
fontio Tweak black_bindings 2022-09-30 11:18:13 -05:00
framebufferio Tweak black_bindings 2022-09-30 11:18:13 -05:00
frequencyio Tweak black_bindings 2022-09-30 11:18:13 -05:00
getpass Tweak black_bindings 2022-09-30 11:18:13 -05:00
gifio Tweak black_bindings 2022-09-30 11:18:13 -05:00
gnss Tweak black_bindings 2022-09-30 11:18:13 -05:00
hashlib Tweak black_bindings 2022-09-30 11:18:13 -05:00
i2ctarget Update I2CTarget.c 2022-10-03 13:09:40 +01:00
imagecapture Tweak black_bindings 2022-09-30 11:18:13 -05:00
ipaddress Tweak black_bindings 2022-09-30 11:18:13 -05:00
is31fl3741 Tweak black_bindings 2022-09-30 11:18:13 -05:00
keypad Tweak black_bindings 2022-09-30 11:18:13 -05:00
math Tweak black_bindings 2022-09-30 11:18:13 -05:00
mdns Tweak black_bindings 2022-09-30 11:18:13 -05:00
memorymonitor Tweak black_bindings 2022-09-30 11:18:13 -05:00
microcontroller Tweak black_bindings 2022-09-30 11:18:13 -05:00
msgpack Tweak black_bindings 2022-09-30 11:18:13 -05:00
neopixel_write Tweak black_bindings 2022-09-30 11:18:13 -05:00
nvm restore nvm module 2022-10-06 13:18:19 -05:00
onewireio Tweak black_bindings 2022-09-30 11:18:13 -05:00
os Tweak black_bindings 2022-09-30 11:18:13 -05:00
paralleldisplay Tweak black_bindings 2022-09-30 11:18:13 -05:00
ps2io Tweak black_bindings 2022-09-30 11:18:13 -05:00
pulseio Tweak black_bindings 2022-09-30 11:18:13 -05:00
pwmio Tweak black_bindings 2022-09-30 11:18:13 -05:00
qrio Tweak black_bindings 2022-09-30 11:18:13 -05:00
rainbowio Tweak black_bindings 2022-09-30 11:18:13 -05:00
random Tweak black_bindings 2022-09-30 11:18:13 -05:00
rgbmatrix Tweak black_bindings 2022-09-30 11:18:13 -05:00
rotaryio Tweak black_bindings 2022-09-30 11:18:13 -05:00
rtc Tweak black_bindings 2022-09-30 11:18:13 -05:00
sdcardio Tweak black_bindings 2022-09-30 11:18:13 -05:00
sdioio Tweak black_bindings 2022-09-30 11:18:13 -05:00
sharpdisplay run black_bindings across all bindings 2022-09-27 15:21:42 -05:00
socketpool Tweak black_bindings 2022-09-30 11:18:13 -05:00
ssl Add support for SSL client certificate (load_cert_chain) 2022-10-10 15:10:53 -05:00
storage Tweak black_bindings 2022-09-30 11:18:13 -05:00
struct Tweak black_bindings 2022-09-30 11:18:13 -05:00
supervisor implement suggested change 2022-10-04 08:28:48 +05:30
synthio Tweak black_bindings 2022-09-30 11:18:13 -05:00
terminalio Tweak black_bindings 2022-09-30 11:18:13 -05:00
time Tweak black_bindings 2022-09-30 11:18:13 -05:00
touchio Tweak black_bindings 2022-09-30 11:18:13 -05:00
traceback Tweak black_bindings 2022-09-30 11:18:13 -05:00
uheap Tweak black_bindings 2022-09-30 11:18:13 -05:00
usb Tweak black_bindings 2022-09-30 11:18:13 -05:00
usb_cdc Tweak black_bindings 2022-09-30 11:18:13 -05:00
usb_hid Tweak black_bindings 2022-09-30 11:18:13 -05:00
usb_host Tweak black_bindings 2022-09-30 11:18:13 -05:00
usb_midi Tweak black_bindings 2022-09-30 11:18:13 -05:00
ustack Tweak black_bindings 2022-09-30 11:18:13 -05:00
vectorio Tweak black_bindings 2022-09-30 11:18:13 -05:00
watchdog Tweak black_bindings 2022-09-30 11:18:13 -05:00
wifi handle scan channel bounds but note they do nothing for RP2040 CYW43 2022-10-07 16:22:17 -04:00
zlib Tweak black_bindings 2022-09-30 11:18:13 -05:00
help.rst Apply a Sphinx transform to make the core module docs look better 2020-08-07 00:01:31 +09:00
index.rst docs: Improve 5.0.x <-> main branch doc linkrot 2020-06-14 11:12:35 -05:00
support_matrix.rst add missing native modules to support matrix 2022-10-04 19:22:18 -04:00
util.c Conditionalize LTO 2022-05-27 12:59:54 -07:00
util.h Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00