Getting a SSL certificate issue in existing site in local system.
Could someone assist me how I can resolve this ?
Most probably your website uses wrong certificate or certificate already expired.
Create new certificate:
Start powershell as administrator and run New-SelfSignedCertificate
with proper parameters. Depending on your powershell version, you may need to include different set of parameters, so best check New-SelfSignedCertificate documentation if the one below doesn't work for you:
New-SelfSignedCertificate -DnsName "your.local" -CertStoreLocation "cert:\LocalMachine\My"
That will create new certificate in your personal store.
Add new certificate to trusted store
Start Microsoft Management Console by running mmc.exe
Click File
-> Add/Remove Span-in
Double click Certificates
and select Computer Account
, then select Local computer
if asked.
Expand Personal
and select Certificates
. You should see your new certificate there. And potentially the old one as well. You can distinguish them by Expiration Date
.
Remove the old one if it's there.
Copy new certificate to Trusted Root Certification Authorities\Certificates
(e.g. drag and drop with ctrl
key pressed).
Check if new certificate is there in Trusted Root Certification Authorities\Certificates
and remove old one if it's there.
Update binding on IIS
Go to IIS manager, select your site and edit bindings. Select your new certificate:
Retest in browser
That should do the trick. Open your browser (best in private mode as certificates can be cached e.g. in chrome) and check if your new certificate is used and marked as secure: