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.
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 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
- Grant Read on the private key to the app pool/service identity
- Import to LocalMachine\My with the private key
- Use
icaclson the key file
Detailed fix by platform
PowerShell
- 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
- Identity — Has key access?
- Store — LocalMachine?
- 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:
Similar errors
Most viewed in SSL / TLS
- HTTPSConnectionPool: Max retries exceeded (SSLError) Python requests: HTTPSConnectionPool(host='api.example.com', port=443): Max retries exceeded with url: /v1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ...')))
- DST Root CA X3 expired (old clients fail) Old clients: certificate has expired — Let's Encrypt chain uses expired DST Root CA X3 (OpenSSL 1.0.x, Android < 7.1.1)
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 18 Nov 2026