Symptoms
-
On a Plesk for Linux server, a scheduled task of type Run a command with
curl
orwget
(for example,curl https://example.com/some-url
) fails:PLESK_INFO: SSL certificate problem: unable to get local issuer certificate
PLESK_INFO: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certsPLESK_INFO: ERROR: The certificate of ‘example.com’ is not trusted.
ERROR: The certificate of ‘example.com’ hasn’t got a known issuer.
Cause
By default, scheduled tasks with the type Run a command are executed in the chrooted shell /bin/bash.
In this shell, there are no common CA certificates to verify SSL connections.
Resolution
Log in to Plesk and apply one of the solutions:
1. For server level tasks:
-
Change the option Task type in the scheduled task to Fetch a URL.
-
Change the default shell for scheduled tasks: go to Tools & Settings > Scheduled Tasks (Cron jobs) > Settings, select /bin/bash or /bin/sh in the option Crontab shell and click OK or Apply to save the changes.
2. For domain level tasks:
- Change the default shell for scheduled tasks: go to Domains > example.com > Web Hosting Access, select /bin/bash or /bin/sh in the option Access to the server over SSH and click OK or Apply to save the changes.