1. Download Trusted Self signed certificate generator Tool.
2. Extract the Zip File and run the tool
Now Simply enter your domain name “Website Domain”, Your certificate pfx file path, and the certificate password that you choose. And click create.
Now to check if everything went as expected. Open IIS manager “Inetmgr” from the command line.
Now the IIS manager will open, click on your server then certificates.
This tool simply runs a PowerShell script that creates a self signed certificate with a custom DNS name
New-SelfSignedCertificate -certstorelocation cert:\\localmachine\\my -dnsname YourDomain
Then in the next step just add this certificate to the Trusted certificate store on your pc.
If you are interested in getting the source code, just comment below and I will send it to you.