anvil-works / anvil-pico

MicroPython modules for using Anvil on the Pico W
https://anvil.works/pico
MIT License
16 stars 4 forks source link

invalid ssl certificate #3

Open patate1684 opened 2 years ago

patate1684 commented 2 years ago

I included all files to my micropython build on a pi pico w and I am getting this error :

Connecting to Anvil... Exception in uplink reconnection loop: Traceback (most recent call last): File "/lib/anvil/pico.py", line 153, in _connect_async File "/lib/anvil/pico.py", line 111, in _connect File "/lib/async_websocket_client.py", line 93, in handshake ValueError: invalid cert

how can I get the right certificate ?

Jacob-OTW commented 1 year ago

I had a similar issue when trying to run the Anvil server on an ESP32, and I was able to just remove the keyword argument outright and it still connected.

Just replace self.sock = ssl.wrap_socket(self.sock, server_hostname=self.uri.host, cert_reqs=ssl.CERT_REQUIRED, ca_certs=ca_certs) with self.sock = ssl.wrap_socket(self.sock, server_hostname=self.uri.host) in the async_websocket_client.py file