At first glance, this looks like you’re trying to use the SDK against an openBalena instance where you’ve generated your own certificate. You should be able to use the REQUESTS_CA_BUNDLE envvar to point to a file containing trusted CAs (so in this case, pointing to a file with your self-signed CA in). This should then allow python to correctly verify the server certificate as valid.
Hi, I am having the same trouble to connect to balena through the python sdk, how did you manage to solve it? by doing export REQUESTS_CA_BUNDLE='/path/to/cert/ca.crt' ?
I am not an expert with the python SDK but you will need to do a couple of things:
make sure your instance’ root CA is trusted
make sure your instance hostname is being used instead of balenaCloud
The first point should be achieved by the mechanism you mentioned; using the bundle environment variable.
The second point I am not sure, but it looks like the SDK is pulling the config from your home directory ~/.balena/ so take a look in there and see if the API URLs are pointing to your openBalena instance.