Troubleshooting Guide: SQL Server Error 13214 – Destination Certificate Issuer Name Mismatch
Why This Error Happens
Error 13214 occurs during Database Mirroring or Always On Availability Group endpoint authentication when the certificate presented by the destination (partner) server does not match the issuer name expected by the initiating server. This typically happens because the certificates on each SQL Server instance were generated independently rather than from a shared trusted Certificate Authority (CA), or because the certificate was recreated/renewed on one node without updating the corresponding public key on the partner node. It can also occur if the system clock between Windows Server 2025 nodes has drifted, causing certificate validity checks to fail.
Step-by-Step Resolution Guide
Step 1: Verify Certificate Details on Both Instances
- Open SQL Server Management Studio (SSMS) on both the principal and mirror/secondary instances.
- Run the following query on each instance to inspect the certificate issuer and expiration:
SELECT name, subject, issuer_name, start_date, expiry_date
FROM sys.certificates;
- Confirm that the
issuer_nameandsubjectfields align with what each endpoint expects from its partner.
Step 2: Re-Export and Re-Import the Correct Public Key Certificates
- On the source server, back up the certificate used for the mirroring endpoint:
BACKUP CERTIFICATE Mirror_Cert
TO FILE = 'C:\Certs\Mirror_Cert.cer';
- Copy the
.cerfile securely to the partner server (e.g., via a shared folder orrobocopy). - On the destination server, drop the outdated certificate and recreate it using the correct file:
CREATE CERTIFICATE Mirror_Cert_Partner
FROM FILE = 'C:\Certs\Mirror_Cert.cer';
Step 3: Synchronize System Time Across Nodes
- Open PowerShell as Administrator on each Windows Server 2025 node.
- Run
w32tm /resyncto force time synchronization with the domain controller or NTP source. - Confirm both servers are within a few seconds of each other using
w32tm /stripchart /computer:<PartnerServerName>.
Step 4: Recreate the Mirroring/AG Endpoint Authentication
- Drop and recreate the database mirroring endpoint on the affected instance:
DROP ENDPOINT Mirroring_Endpoint;
CREATE ENDPOINT Mirroring_Endpoint
STATE = STARTED
AS TCP (LISTENER_PORT = 5022)
FOR DATABASE_MIRRORING (AUTHENTICATION = CERTIFICATE Mirror_Cert_Partner, ROLE = ALL);
- Restart the SQL Server service on both nodes to reload the endpoint security context.
Step 5: Validate Trust Chain in Windows Certificate Store
- Open
certlm.mscon both servers and check the Trusted Root Certification Authorities store. - Ensure both SQL Server service accounts have read access to the certificate’s private key via Manage Private Keys.
Alternative or Verification Steps
- Re-attempt the mirroring session or Availability Group join operation and check the SQL Server error log for successful endpoint authentication (absence of Error 13214).
- If the issue persists, use
netsh advfirewallto confirm port 5022 (or your custom mirroring port) is not blocked, as firewall interference can sometimes produce a secondary certificate handshake failure that mimics this issuer name error.