I have a python program that uses the aws iot sdk to connect to mqtt. The programs runs, and works without problems when I run it from the CLI. But when I try to run it from systemd as a service, it doesn't work... And I don't know why. I found these 2 references below about the problem, but it seems like none of them fixes my problem.
I receive an error message like this:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)
UPDATE: this is my current service file
[Unit]
Description=GreenRpi
[Service]
User=pi
Group=pi
#PIDFile=/tmp/greenrpiofficial-99.pid
WorkingDirectory=/home/pi/experiments/GreenRpi/
ExecStart=/home/pi/experiments/GreenRpi/.venv/bin/python main.py somearg
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target