private key SSL / TLS Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

Windows: private key access denied — application pool/service account can't read the certificate's key

The certificate is in the store, but the app's identity has no permission on its private key, so TLS fails.

Exact message you may see Keyset does not existCannot find the certificate private keyprivate key access denied app poolSystem.Security.Cryptography.CryptographicException: Keyset does not existA specified logon session does not exist certificate
Seen on: Windows IIS .NET

Meaning

In certlm.msc, open Manage Private Keys on the certificate and grant Read to the app pool identity (IIS AppPool\SiteName) or service account. Machine-store keys live in %ProgramData%\Microsoft\Crypto\RSA\MachineKeys. For CNG keys use the corresponding folder.

Common causes

  • App pool identity lacks key permissions
  • Certificate imported without private key
  • Key stored in a user store, not machine store
  • Service account changed
  • CNG key permission missing

⚡ Quick fix

  1. Grant Read on the private key to the app pool/service identity
  2. Import to LocalMachine\My with the private key
  3. Use icacls on the key file

Detailed fix by platform

PowerShell

  1. bash
    $cert = Get-ChildItem Cert:\LocalMachine\My | Where Thumbprint -eq "THUMB"
    $key = $cert.PrivateKey.CspKeyContainerInfo.UniqueKeyContainerName
    icacls "$env:ProgramData\Microsoft\Crypto\RSA\MachineKeys\$key" /grant "IIS AppPool\MySite:R"

How to diagnose

  1. Identity — Has key access?
  2. Store — LocalMachine?
  3. Key — Present?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

0x800CCC0D — Outlook error 0x800CCC0D: Cannot find the server — the host name of the mail server couldn't be resolved (Email / SMTP)0x800CCC0D0x800CCC0E — Outlook error 0x800CCC0E: Cannot connect to the outgoing (SMTP) server — sending failed (Email / SMTP)0x800CCC0E400 — 400 Bad Request: Invalid Hostname (HTTP)400440 — HTTP 440 Login Time-out (IIS) (HTTP)440certificate does not have a private key (IIS) — Windows/IIS: A specified logon session does not exist / The certificate does not have a private key associated with it (SSL / TLS)certificate does not …Could not establish trust relationship for the SSL/TLS secure channel — .NET: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel (SSL / TLS)Could not establish t…CRYPT_E_NO_REVOCATION_CHECK — curl (Windows Schannel): schannel: next InitializeSecurityContext failed: CRYPT_E_NO_REVOCATION_CHECK (0x80092012) - The revocation function was unable to check revocation for the certificate (SSL / TLS)CRYPT_E_NO_REVOCATION…Django — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)Djangoprivate k…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.