#The requests module and SSL/TLS

1 messages · Page 1 of 1 (latest)

lusty fog
#

I am trying to connect to a local (on same LAN) JSON REST API. The API only has a self-signed cert at the moment.

Is there a way to ignore cert trust errors when making a request using the requests module?

sleek hare
#

what board are you using?

lusty fog
#

I am using the PyPortal. As far as I can tell the PyPortal doesn't support socketpool. Is there a way to provide the pem file without the socket pool?

sleek hare
lusty fog
#

The docs indicate that method is for setting a client cert. Is the idea that, that method pulls double duty and allows the use of self-signed certs on web servers the device accesses?

sleek hare
#

That was tested to use when requesting from servers with a cert that was not working with the old cert store in the NINA firmware, and you get around it (if the cert was <1300 bytes -- bug) by getting the cert from the server and feeding it to that function. "Client" may be odd there, but the client is supplying the (self-signed? -- TBD) certificate that the server expects.

lusty fog
#

I'm sorry I am a little dense. You are saying that if I get the server's certificate and pass it to set_certificate the client (the PyPortal in my case) will then trust the server's certificate?

sleek hare
#

I hoping that's the case. That process works for other certs that just aren't in the local cert store. I don't recall if self-signed has been tested on ESP32SPI.

lusty fog
#

Well I will give it a shot, and report back here.

sleek hare