Hey so heres a little more info about my setup.
Virtualmin hosted on centos7x64, using whmcs auto provisioning to create servers automatically after purchase. Everything works perfectly without ssl. Although as soon as i enable ssl with letsencrypt, you can no longer create new domains through whmcs, it starts giving errors.
When the domain creation starts on whmcs with ssl enabled, usually it will hang then give whmcs an error saying the domain is already created on the server and therefore it cannot process the order.
I get other errors as well occasionally.. Sometimes it cant copy the php.ini to the home directory associated with the domain, I tried setting permissions accordingly but its evident that the permissions isn't what's causing this issue.
I hit a major road block after isolating the issue that many others are having it seems over the years many others like me got this very issue. Its just hard to isolate as the ssl is causing many other issues in the installation logs causing users to be directed in the wrong direction while troubleshooting.
Its evident to me that its an SSL issue with virtualmin, since i can get whmcs and virtualmin to work flawlessly without any ssl enable. I tried on ubuntu, centos, with bind nameservers and with vanity nameservers to name a few. I have been going at it for a week and I simply cant keep going like i this.. I figured i'd turn to the forums for some help.
For more info about the errors i got specifically, I made a post a few days ago before i knew exactly what the culprit was. https://www.virtualmin.com/node/66178 also a support ticket about some users with the same issue. https://www.virtualmin.com/node/48601
In conclusion, after many hours of fiddling with this, I concluded that when sending the create-domain.pl function from whmcs while having ssl enabled on both sides, the connection either times out or simply gets disconnected briefly. When this happens i'm assuming whmcs tried to send the same domain-creation array to virtualmin causing the response to be an error saying that the domain or administrator user already exists.
Who's at fault here? Virtualmin or whmcs?