1 - Check that you should have an A record for the hostname. For example if your server hostname is cp.hostinpk.com, then you should have an A record for "cp" pointing to server IP
2 - Login to CWP Admin Panel>> Server Settings>>Change Hostname and then hit "Change Hostname" button after putting your desired hostname (in my case cp.hostinpk.com). This will only generate a valid LE SSL for your hostname when an A record is present against hostname
3 - Perform following command from shell