The post explaining it is still at HTTPS connection with "Warning: Potential Security Risk" or invalid certificate - #6 by acolomb. However, you should use an updated version that uses different paths to access the needed directories. Just the new script content listed again here in modified form, read the original post for the explanation.
SYSTEM_CERT_DIR=/usr/syno/etc/certificate/system/default
SYNCTHING_CONF_DIR=/var/packages/syncthing/target/var
SYNCTHING_USER=sc-syncthing
SYNCTHING_GROUP=syncthing
API_KEY=InsertYourAPIKeyHere
sudo cp -v --preserve=timestamps ${SYSTEM_CERT_DIR}/cert.pem ${SYNCTHING_CONF_DIR}/https-cert.pem
sudo cp -v --preserve=timestamps ${SYSTEM_CERT_DIR}/privkey.pem ${SYNCTHING_CONF_DIR}/https-key.pem
sudo chmod 664 ${SYNCTHING_CONF_DIR}/https-cert.pem
sudo chmod 600 ${SYNCTHING_CONF_DIR}/https-key.pem
sudo chown ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_CONF_DIR}/https-cert.pem
sudo chown ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_CONF_DIR}/https-key.pem
sudo ls -l ${SYNCTHING_CONF_DIR}
curl -k -X POST -H "X-API-Key: ${API_KEY}" https://localhost:8384/rest/system/restart
Hope that helps, feel free to ask if anything is unclear @elfzweik.