This is more Arduino-Pico than straight Pico related, but for completeness if folks find this later...
TLS (used under the hood for HTTPS) is built to provide not just encryption but also authentication (i.e. guarantee you're talking to the real server and not a MITM). It needs for you to give it the certificates you want to trust ("root of trust"). You can use self-signed certs or CAs for private home automation servers, or global certificate authorities for the general internet.
See the BearSSL_Validation and BearSSL_CertStore examples for different methods of specifying approved certificates (or bundles of certs). Otherwise, your setInsecure tells BearSSL to encrypt, but not verify certificates. For your specific call, it's probably fine. If you were trying to connect to AWS or a bank or a SMS gateway, I'd probably ensure the proper CAs are set.
For safety, if you don't set a certificate or disable checks BearSSL in the Arduino-Pico core will immediately return an error (and dump a message id you have the Debug port defined). Maybe someone who uses/works on MicroPython can chime on on how they handle it?
TLS (used under the hood for HTTPS) is built to provide not just encryption but also authentication (i.e. guarantee you're talking to the real server and not a MITM). It needs for you to give it the certificates you want to trust ("root of trust"). You can use self-signed certs or CAs for private home automation servers, or global certificate authorities for the general internet.
See the BearSSL_Validation and BearSSL_CertStore examples for different methods of specifying approved certificates (or bundles of certs). Otherwise, your setInsecure tells BearSSL to encrypt, but not verify certificates. For your specific call, it's probably fine. If you were trying to connect to AWS or a bank or a SMS gateway, I'd probably ensure the proper CAs are set.
For safety, if you don't set a certificate or disable checks BearSSL in the Arduino-Pico core will immediately return an error (and dump a message id you have the Debug port defined). Maybe someone who uses/works on MicroPython can chime on on how they handle it?
Statistics: Posted by earlephilhower — Sat Jan 03, 2026 12:06 am