DLG_FLAGS_SEC_CERT_CN_INVALID means the name inside a website's certificate does not match the address you asked for. Windows checks the host name, finds no match, and stops the page. Visitors can often fix it by correcting the address. Site owners fix it by reissuing the certificate.
DLG_FLAGS_SEC_CERT_CN_INVALID is a Windows certificate flag. It is set when the requested host name is not covered by the certificate the server sent.
What Does DLG_FLAGS_SEC_CERT_CN_INVALID Mean?
The text comes from WinINet, the Windows internet library, and Microsoft lists it among its WinInet security flags. The related code 12038 means the certificate name does not match the requested name, as Microsoft's WinHTTP error list describes. Chrome shows the same problem as NET::ERR_CERT_COMMON_NAME_INVALID.
In plain terms, the certificate claims one name while you asked for another. Windows cannot trust the padlock for that name, so it warns you instead of loading the page.
What Is the Difference Between the Common Name and a SAN?
The common name is one legacy name in the certificate subject. The subject alternative name, or SAN, is a list of every host name the certificate covers. Modern browsers match your address against the SAN list, so a certificate without one can fail.
| Field | What it holds | Where it matters |
|---|---|---|
| Common name (CN) | One name in the subject line | OpenSSL and curl still read it when no SAN exists in our test |
| Subject alternative name (SAN) | A list of host names | The field browsers check first |
Certificate authorities now put every name in the SAN list, including the bare domain and www. Check that list before you blame the browser.
Why Does the Certificate Name Not Match?
A few causes account for most mismatches. The table lists each one, with a sign that points to it and a fix. We reproduced the first three on a local test certificate authority, using OpenSSL 3.0.13, so those rows are real results.
| Cause | Sign | Fix |
|---|---|---|
| Certificate issued for another name | The names listed differ from the address you typed | Use the right address or reissue the certificate |
| Wildcard does not reach the name | The bare domain or a deeper subdomain fails | Add those names to the certificate |
| No subject alternative name | The certificate has only a common name | Reissue it with a subject alternative name |
| Proxy or antivirus HTTPS scanning | The issuer is a security product, not a public CA | Check the scanner settings (not tested here) |
| IP address in the address bar | Certificates list host names, not IPs | Use the host name instead |
| DNS or hosts file points to the wrong server | Another site's certificate appears | Correct the DNS or hosts entry (not tested here) |
How Do You See Which Names a Certificate Covers?
Read the subject alternative name list, not only the common name. OpenSSL prints it with x509 -ext. To test a live server against the name you typed, add -verify_hostname to s_client. A mismatch ends with return code 62 and the words hostname mismatch.
openssl x509 -in bad.pem -noout -subject -ext subjectAltName
openssl s_client -connect 127.0.0.1:8443 -servername www.example.test -CAfile ca.pem -verify_hostname www.example.test
Recreated card. The names and return code come from our real OpenSSL test: the certificate named shop.example.test, so www.example.test failed.
curl failed the same way and said no alternative certificate subject name matches the target host name. More commands like these are in our OpenSSL commands cheat sheet.
Does a Wildcard Certificate Cover Every Name?
No. A wildcard replaces exactly one label, and nothing more. In our run, *.example.test matched www.example.test but failed for example.test and for a.b.example.test. Add the bare domain and deeper names as separate entries, or choose a certificate type that lists several names.
| Name requested | Result with a *.example.test certificate |
|---|---|
| www.example.test | Verification OK |
| example.test | hostname mismatch (return code 62) |
| a.b.example.test | hostname mismatch (return code 62) |

Recreated diagram of the wildcard rule, based on three real s_client checks against one wildcard test certificate.
If you need many names, compare a wildcard SSL certificate against a multi-name option before you buy.
How Can You Tell a Proxy Is Replacing the Certificate?
Look at the issuer. A public website normally shows a public certificate authority, while a security product that scans HTTPS shows its own name. We tested only the command, against our local server, where it printed our test CA. We did not test a real scanning product.
openssl s_client -connect www.example.com:443 -servername www.example.com </dev/null 2>/dev/null | openssl x509 -noout -issuer -subjectOn our test server the issuer was Test Lab Root CA. Compare the issuer on a home and a work network, because a change between them points at the network.
How Do You Fix the Error as a Visitor?
Start with the address. Check for typos, then try the version with and without www. If the warning stays, look at who issued the certificate, because a proxy or antivirus can swap it. Do not continue on a login or payment page.
- Retype the address and compare the www and non-www versions.
- Open the warning or padlock details and read the names the certificate lists.
- Check whether the issuer is a security product instead of a public CA. If it is, review that product's HTTPS scanning settings.
- Try another network or device. If the error vanishes, the cause sits in your network or software.
- Leave the page if the name still does not match.

Recreated warning page. We could not capture the real one because the test browser refuses certificate error pages, so this image only mimics the layout.
You can also paste the address into our SSL checker tool to review the certificate a site sends. A wrong clock does not cause this error, because Windows uses a separate flag, DLG_FLAGS_SEC_CERT_DATE_INVALID, for date problems.
How Do You Fix It as the Site Owner?
Reissue the certificate with every name your visitors use listed as a subject alternative name. Put the bare domain and www in the same request, then install the new certificate and restart the server. In our test, both names verified OK after the reissue.
openssl req -new -newkey rsa:2048 -nodes -keyout www.key -out www.csr -subj "/CN=www.example.test" -addext "subjectAltName=DNS:www.example.test,DNS:example.test"Our request showed both names under Subject Alternative Name, and its signature verified OK. Your CA may want the names in its own form, and our CSR generator tool can build the request.
When one server hosts several sites, always send the name with -servername while testing. Without it, a server may answer with its default certificate instead (not tested here).

Recreated card. Both results come from real runs: the old certificate failed, and after the reissue both names passed and curl returned HTTP 200.
How Do You Confirm the Fix Worked?
Test every name visitors use, not just one. Run the same hostname check for the bare domain and for www, then request the page with curl. We ran these checks after our reissue and each returned OK. Finish with a browser check from a device that has not seen the site.
- Run openssl s_client with -verify_hostname for each name and expect return code 0.
- Request each name with curl and expect HTTP 200 without a certificate warning.
- Open the site in a browser on a clean profile (not tested in this run).
- Check the expiry date, so a new problem does not follow the first.
Why Do OpenSSL and curl Accept What Chrome Rejects?
Older rules let software fall back to the common name when no subject alternative name exists. Our certificate with only CN=www.example.test passed in OpenSSL and curl. Chrome stopped using that fallback in version 58, as a Chromium security thread records, so the same certificate fails there.
A command-line pass therefore proves little about browsers. Always include the subject alternative name, and test with the exact name that visitors type.
Frequently Asked Questions
Is DLG_FLAGS_SEC_CERT_CN_INVALID the same as DLG_FLAGS_INVALID_CA?
No. The first is a name mismatch. The second means Windows does not trust the issuer. Both can appear together on one warning page.
Does the error mean the website is hacked?
Not by itself. Most cases are a certificate issued for a different name. Interception can cause the same warning, so avoid entering passwords until you know the cause.
Can I click through the warning?
Some pages allow it, but doing so skips the name check. Do it only on a site you control.
What does 'This site is not secure' mean with this code?
Edge and Internet Explorer mode show that wording when the certificate name fails the check. The page may still load in plain form, but the name cannot be trusted.
Is NET::ERR_CERT_COMMON_NAME_INVALID the same problem?
Yes. Chrome uses that code for the same name mismatch, and since version 58 it counts only the SAN list.
Will clearing the cache fix it?
Only when a cached page or DNS entry points to an old server. A certificate that lacks the name must be reissued.
