I just posted a thing you can try to fix your certificate problem in this thread:
We already covered the “using API to add test results” topic in the following thread with you:
I cannot give you exact code for Python, that’s unfortunately beyond our level of support.
Again, I can just stress that using the CLI will do everything for you, so let’s try to make the CLI work for you.