Unable to install Cloudflare SSL on subdomain

When I try to install cloudflare origin certificate SSL for subdomain.yourdomain.tld it shows the following

Error: SSL intermediate chain is not valid

I have run the following code

cd /usr/local/hestia/func/
mv domain.sh domain.sh.backup
wget https://raw.githubusercontent.com/sahsanu/hestiacp/c86b04be7dfe1cca56825f81dc4c3477436b7233/func/domain.sh

There are several threads here. Suggest go through these once: Search results for 'cloudflare ssl' - Hestia Control Panel - Discourse