/ โ† Security Audit Fixes / IIS SSL bindings
In this guide
  1. Why IIS hides a certificate from the bindings list
  2. The common causes
  3. How to check the certificate and its key
  4. Importing a certificate the right way
  5. Setting up HTTPS bindings with SNI
  6. Worked example: the certificate that vanished
  7. The fix, step by step
  8. Edge cases worth knowing
  9. Keeping IIS certificates working
  10. Questions and answers

Why IIS hides a certificate from the bindings list

The SSL certificate drop-down in the Add Site Binding dialogue does not list every certificate on the machine. It lists certificates in the local computer's Personal store (also shown as My) or the Web Hosting store that have a matching private key on this server. A certificate without its private key is useless to a web server, because the server cannot prove it owns the certificate, so IIS leaves it out.

That gives three questions to answer when a certificate is missing:

If the answer to any of these is no, the certificate will not show in IIS. If the certificate does show and still does not work, the problem is in the binding: the wrong host name, SNI not ticked, or another site on the same IP and port taking priority. For the general picture of certificate errors outside IIS, see fixing SSL errors.

The common causes

CauseTypical signFix
Request completed on a different server from the one that made the CSRCertificate appears after Complete Certificate Request, then vanishes when you refreshComplete it on the original server, or rebuild the key link with certutil
Imported a .cer or .crt file onlyCertificate visible in the snap-in with no key iconImport a .pfx that contains the key
Imported into the Current User storeVisible in certmgr.msc but not in IISImport into Local Computer, Personal
Imported into the wrong folderSits under Intermediate or Trusted RootMove it to Personal
PFX made with newer encryption than Windows supportsImport fails with a password or format error on older Windows ServerRe-export the PFX with legacy encryption
Binding without host name or SNIEvery site on the server gets the same certificateAdd host name and tick Require Server Name Indication
Intermediate certificate missingWorks on some devices, fails on othersInstall the intermediate into Intermediate Certification Authorities
๐Ÿ’ก The vanishing certificate after Complete Certificate Request is the classic IIS symptom. The private key was created on the machine that generated the CSR, so the issued certificate can only be completed there, or joined to that key with certutil if the key exists on this machine.

How to check the certificate and its key

Open PowerShell as administrator and list the certificates in the local Personal store with their key status:

Get-ChildItem Cert:\LocalMachine\My |
  Select-Object Subject, Thumbprint, HasPrivateKey, NotAfter, @{n='DNS';e={$_.DnsNameList -join ', '}} |
  Format-List

Find your certificate by its subject or DNS names. If HasPrivateKey is False, IIS will not offer it. Also check NotAfter for the expiry date and the DNS list for every hostname you need.

To see what HTTP.sys, the part of Windows that actually handles TLS for IIS, has bound to each address:

netsh http show sslcert

Entries labelled IP:port are bindings without SNI, which apply to every hostname on that address. Entries labelled Hostname:port are SNI bindings for one hostname. The certificate hash shown should match the thumbprint of the certificate you expect.

Repairing the link to a private key

If the key does exist on this machine, for example because the CSR was made here but the response was imported as a plain file, certutil can join them again. Use the certificate's serial number or thumbprint:

certutil -repairstore my "1a2b3c4d5e6f7081"

A message that the encryption test passed means the key was found and linked. Refresh Server Certificates in IIS and the certificate now appears. If certutil cannot find a key, it was never on this server, and you need either a PFX from the machine that made the CSR or a new request.

Importing a certificate the right way

The safest format for IIS is a PFX (also called PKCS#12) file, which carries the certificate, its private key and usually the intermediate certificates in one password-protected file. In IIS Manager, select the server, open Server Certificates and choose Import. Pick the PFX, enter its password and choose the Personal or Web Hosting store.

The same import in PowerShell:

$pw = Read-Host -AsSecureString -Prompt "PFX password"
Import-PfxCertificate -FilePath C:\certs\example.pfx `
  -CertStoreLocation Cert:\LocalMachine\My -Password $pw

Building a PFX from PEM files

If your authority or another server gave you separate PEM files, combine them with OpenSSL. OpenSSL 3 encrypts the PFX with modern AES settings by default, which older Windows Server versions such as 2016 cannot read, so add -legacy when the target is an older server:

openssl pkcs12 -export -out example.pfx \
  -inkey privkey.pem -in cert.pem -certfile chain.pem -legacy

Keep the PFX file and its password safe, and delete copies from download folders once imported. Anyone with both can run a site as your domain.

โš ๏ธ Double-clicking a PFX in Explorer imports it into your own user store by default, where IIS cannot see it. Choose Local Machine in the wizard, or import through IIS Manager or PowerShell instead.

Setting up HTTPS bindings with SNI

In IIS Manager, select the site, choose Bindings, then Add. Set Type to https, IP address to All Unassigned, port 443, and enter the host name, for example www.example.com. Tick Require Server Name Indication, choose the certificate and save. Add a separate binding for each hostname the site answers to, such as the bare domain and www.

The same binding in PowerShell, using the WebAdministration module:

Import-Module WebAdministration
New-WebBinding -Name "Example Bakery" -Protocol https -Port 443 `
  -HostHeader "www.example.com" -SslFlags 1
$cert = Get-ChildItem Cert:\LocalMachine\My |
  Where-Object { $_.DnsNameList -contains "www.example.com" } | Select-Object -First 1
(Get-WebBinding -Name "Example Bakery" -Protocol https -HostHeader "www.example.com").AddSslCertificate($cert.Thumbprint, "my")

-SslFlags 1 turns on SNI. Without it, the binding is an IP and port binding, and only one certificate can be used for all sites on that address and port. IIS warns you if another site already uses the same non-SNI binding, and saving replaces the certificate for both sites, which is a common way to break a second site by accident.

Binding settingUse it when
Host name plus SNISeveral HTTPS sites share one IP address, which is the usual case
No host name, no SNIOne fallback site per IP address, for clients that send no host name
Centralized Certificate StoreA web farm loading PFX files from a shared folder by host name

Worked example: the certificate that vanished

An agency created a CSR for www.example.com on a staging server, ordered the certificate, then ran Complete Certificate Request on the live server. The certificate appeared in Server Certificates, then disappeared after a refresh, and never showed in the bindings list.

  1. Get-ChildItem Cert:\LocalMachine\My on the live server showed the certificate with HasPrivateKey set to False.
  2. certutil -repairstore my with its serial number reported that no key was found, confirming the key lived on staging.
  3. On the staging server, the agency completed the request there, then exported the certificate as a PFX with its private key and the full chain.
  4. They imported the PFX on the live server into Local Machine, Personal. HasPrivateKey now showed True.
  5. They added https bindings for example.com and www.example.com with SNI ticked, then confirmed with netsh http show sslcert that two Hostname:port entries carried the right hash.
  6. A request with curl -vI https://www.example.com showed the new certificate and no TLS error.

The fix, step by step

Step 1

List the certificate and its key

Open PowerShell as administrator and run Get-ChildItem Cert:\LocalMachine\My with Subject, Thumbprint and HasPrivateKey selected. Find the certificate by its subject or DNS names. If it is not listed, it is in the wrong store. If HasPrivateKey is False, IIS will never show it in the bindings list. Note the thumbprint and expiry date, because you will need the thumbprint to check the binding later. Repeat the listing after each change in the steps below.

Step 2

Move it to the right store

If the certificate is in your user store or under Intermediate or Trusted Root, open mmc, add the Certificates snap-in for the Computer account, and drag or re-import it into Personal. Certificates imported by double-clicking a file often land in the Current User store. Refresh Server Certificates in IIS Manager afterwards and check whether the certificate now appears there with the correct name and expiry date.

Step 3

Restore the missing private key

If the certificate has no key, run certutil -repairstore my followed by its serial number. If the CSR was made on this server, certutil finds the key and links it, and the certificate appears in IIS. If certutil reports no key, the key is on the server that made the CSR. Complete the request there and export a PFX, or create a new CSR on this server and ask the authority to reissue.

Step 4

Import a PFX with the key

Get a PFX that holds the certificate, its private key and the chain. Import it through IIS Manager, Server Certificates, Import, choosing the Personal or Web Hosting store, or use Import-PfxCertificate with -CertStoreLocation Cert:\LocalMachine\My. If an older Windows Server rejects the password or format, rebuild the PFX with OpenSSL using -legacy. Confirm HasPrivateKey now shows True for the certificate, and that it appears in the Server Certificates list in IIS Manager.

Step 5

Install the intermediate certificate

Open the certificate in the snap-in and look at the Certification Path tab. If it ends with an error or a missing issuer, import the intermediate certificate from your authority into Intermediate Certification Authorities on the Local Computer. A PFX built with the chain does this automatically. Check the path again and make sure it shows every level up to a trusted root without warnings.

Step 6

Add an https binding per hostname

In IIS Manager open the site's Bindings and add an https binding on port 443 with the host name filled in, for example www.example.com, and Require Server Name Indication ticked. Select the certificate and save. Repeat for the bare domain and any other names the site uses. If IIS warns that another site uses the same binding, stop and add host names and SNI rather than replacing the shared certificate.

Step 7

Check what HTTP.sys has bound

Run netsh http show sslcert and find the entries for your hostnames on port 443. SNI bindings show as Hostname:port, and each certificate hash should match the thumbprint you noted earlier. If an old hash appears, edit the binding and choose the new certificate. Remove stale IP and port bindings that no site needs, as they can hand an old certificate to clients that send no host name.

Step 8

Test from outside the server

From another machine, run curl -vI https://www.example.com and openssl s_client -connect www.example.com:443 -servername www.example.com. Check the certificate subject, the SAN list, the expiry date and Verify return code: 0 (ok). Test every hostname with a binding. Testing on the server itself can be misleading because of local hosts entries and certificates already trusted on that machine. A phone on mobile data is a useful final check.

Step 9

Redirect to https and set renewal

Add an HTTP to HTTPS redirect with the URL Rewrite module in web.config, then test it with curl -I http://example.com, looking for a 301 to the https address. If you use an ACME client such as win-acme, check its scheduled renewal task exists and that it updates the bindings. Otherwise, set a calendar reminder a month before the expiry date shown in the certificate listing.

Edge cases worth knowing

Keeping IIS certificates working

Always generate the CSR and complete the request on the same server, or work with PFX files from the start. Keep a note of each certificate's thumbprint and which bindings use it, and check expiry dates with the PowerShell listing above before they run out. After the certificate works, add an HTTP to HTTPS redirect with the URL Rewrite module, as shown in HTTPS redirects, and set security headers such as HSTS in web.config, as shown in security headers on IIS. Then run the security audit on each hostname.

Questions and answers

1. Why is my SSL certificate not showing in IIS bindings?

Your SSL certificate is not showing in IIS bindings because it has no private key on this server, or because it is not in the Local Computer Personal or Web Hosting store. IIS only offers certificates it can actually use. Check with PowerShell whether HasPrivateKey is true and which store holds the certificate. Importing a PFX file that includes the private key into the Local Computer Personal store, or repairing the key link with certutil, normally makes it appear straight away.

2. Why does my certificate disappear after Complete Certificate Request?

Your certificate disappears after Complete Certificate Request because the private key for it is not on this server. The key is created on the machine that generated the CSR, and IIS drops the certificate from Server Certificates when it cannot pair it with a key. Complete the request on the original server and export a PFX, or run certutil repairstore if the CSR was made here. If the key is lost entirely, create a new CSR and ask the authority to reissue.

3. Why is my IIS SSL certificate not working?

An IIS SSL certificate that shows in the bindings but is not working usually has the wrong binding, a missing intermediate certificate or a hostname that is not on the certificate. Check that each hostname has its own https binding with SNI ticked, that netsh http show sslcert shows the expected certificate hash, and that the certification path is complete. Then test from another machine with curl or OpenSSL, which report the exact error rather than a general warning page.

4. What is Require Server Name Indication in IIS?

Require Server Name Indication is the IIS setting that lets one IP address and port serve different certificates for different hostnames. The browser sends the hostname at the start of the TLS handshake, and IIS picks the certificate bound to that name. Without it, a binding applies to the whole IP address and port, so every site there shares one certificate. Tick it whenever you host more than one HTTPS site on a server, and fill in the host name on each binding.

5. Can I use a .crt or .cer file in IIS?

You can use a .crt or .cer file in IIS only if the matching private key is already on the server, for example because the CSR was generated there. In that case, use Complete Certificate Request or import the file and run certutil repairstore to join it to the key. If the key was created elsewhere, a .crt file on its own will never appear in the bindings list, and you need a PFX that contains both the certificate and its private key.

6. Why does Windows say the PFX password is wrong when it is right?

Windows says the password is wrong when the PFX file was encrypted with settings it cannot read, which often happens with files made by OpenSSL 3 and imported on Windows Server 2016 or older. The password is fine, the encryption format is the problem. Rebuild the PFX with OpenSSL using the legacy option, or export it again from a Windows machine using the older TripleDES with SHA1 option, then import the new file into the Local Computer Personal store.

7. Do I need to rebind the certificate after renewal in IIS?

Yes, in most cases you must rebind the certificate after renewal, because an IIS binding points at one certificate thumbprint and a renewed certificate has a new one. Edit each https binding and choose the new certificate, or update it with PowerShell. ACME clients for Windows usually do this automatically as part of renewal. After rebinding, run netsh http show sslcert to confirm the new hash is in place, and test with curl from another machine to confirm visitors see it.

Check the certificate IIS is sending

Run the security audit on each hostname to see the certificate your IIS server actually sends, its names, issuer and expiry date, and whether the chain is complete.

Open Security Audit Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Security Audit Fixes  ·  Security headers on IIS  ·  Fix SSL errors  ·  SSL certificate not trusted  ·  SSL certificate installed but not working  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.