How to Fix MongoDB Error 299 (OCSPCertificateStatusRevoked)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mongodb error 299 when a TLS certificate fails the OCSP revocation check. To fix it, replace the revoked certificate with a valid one and reload the node. MongoDB names this failure OCSPCertificateStatusRevoked in its official error catalog. The database stops the network link when the issuer marks a certificate as bad. This check protects your cluster from stolen keys and bad network actors. Teams see this error during client logins or replica set heartbeats. What causes mongodb erro

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You get mongodb error 299 when a TLS certificate fails the OCSP revocation check. To fix it, replace the revoked certificate with a valid one and reload the node.

MongoDB names this failure OCSPCertificateStatusRevoked in its official error catalog. The database stops the network link when the issuer marks a certificate as bad. This check protects your cluster from stolen keys and bad network actors. Teams see this error during client logins or replica set heartbeats.

What causes mongodb error 299 in your cluster

TLS links use Online Certificate Status Protocol checks to test certificate health. During a handshake, the server or client asks the issuer about the certificate. If the issuer says the certificate is revoked, the handshake fails right away. MongoDB logs code 299 and closes the network socket to block the peer.

Several operational events trigger this status in a live cluster. A security team might revoke a key after a laptop or server leak. An automated script might replace a certificate and revoke the old one early. If one cluster node still uses the old file, peer nodes reject it.

Client apps also hit this error when their own client certificates get revoked. Intermediate CA revocations cause even wider outages across your whole server fleet. When an intermediate CA is revoked, every leaf certificate under it fails validation. You must check the full certificate chain to find the exact revoked link.

How to diagnose and fix the revoked certificate safely

Start by reading the database error logs on both sides of the link. The log entry shows whether the server certificate or client certificate failed validation. Check the serial number and issuer name of the active certificate file. Ask your certificate authority to confirm which file in the chain is revoked.

Never turn off TLS or OCSP checks in production to bypass the error. Turning off validation leaves your database open to man-in-the-middle network attacks. Instead, issue a fresh certificate from your trusted certificate authority right away. Deploy the new certificate and private key files to the affected host.

MongoDB Authentication & Authorization + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Once the new files are in place, rotate the certificates in the database. Replace the old chain on every affected server node and client app. Test the new handshake from a staging client to verify the OCSP status.

Securing database roles during incident repair

Engineers often log in to inspect cluster state during a certificate outage. Keep your access controls tight while your team works on the fix. MongoDB grants access through role-based rules that apply to a specific database. A role can grant access down to a single collection level.

Do not give engineers broad write roles just to check cluster health. The built-in read role grants read access to all non-system collections. It allows safe read actions like finding records and listing database indexes. It does not allow actions that insert, update, remove, or drop data.

Reserve the readWrite role for apps that must modify collection data. Using read-only roles during repair stops accidental changes to live production tables. You can also apply data masking so queries rewrite emails or card numbers in results. This keeps sensitive user records safe while engineers run diagnostic queries.

Check MongoDB commands and documents on the wire

MongoDB roles and SCRAM login decide who opens a session. They do not check single commands or redact sensitive fields inside returned documents. With hoop.dev, you run an open-source proxy, a sidecar for your MongoDB, inline in the MongoDB wire protocol. On every command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Before a command runs, hoop.dev guardrails check its effect and refuse banned drops or writes with MongoDB error code 13, or hold risky commands for approval. On the way back, hoop.dev data masking rewrites sensitive fields in returned documents in memory, and every verdict is logged. See the open-source code on GitHub.

Frequently asked questions

What does OCSPCertificateStatusRevoked mean in MongoDB?

It means the certificate authority marked the TLS certificate as revoked. MongoDB blocks the connection under error code 299 to protect your data.

Should I disable OCSP checking to clear mongodb error 299?

No, disabling OCSP checks removes protection against stolen or compromised TLS keys. Always fix the issue by deploying a new, valid certificate chain.

Can a client certificate trigger error 299 on the server?

Yes, if your cluster requires mutual TLS, the server checks client certificates. A revoked client certificate causes the server to drop the client login.

The query runs. The emails stay hidden.