I don’t know if my script (in Python) is what you’re talking about, but if so, I’m happy to help on the resource thread for it.
But fundamentally, if you want TrueNAS to use your cert, you need to import it through the API. My script is one way to automate that; @jjrushford’s tnascert-deploy is another.
Here’s more detail on using my script with acme.sh to obtain and import a cert: