Browser Certificate Errors When Using a Proxy: Causes and Troubleshooting Steps
Learn how incorrect system time, DNS interference, man-in-the-middle inspection, and TUN routing can cause certificate errors, and follow practical steps to find the cause.
Note the error code first, then identify the type of certificate problem
On the browser warning page, note the error code and the full hostname in the address bar. If you can view the certificate, record its issuer, validity dates, and Subject Alternative Names (SANs). Don’t proceed to the site behind the warning just to inspect its certificate. Keep the exact same URL while troubleshooting, including the original www or other subdomain. Don’t switch to an IP address, as that can create a hostname mismatch.
| Error code | Meaning | Check first |
|---|---|---|
NET::ERR_CERT_DATE_INVALID |
The certificate has expired or is not yet valid | Device clock and certificate chain validity dates |
NET::ERR_CERT_COMMON_NAME_INVALID |
The certificate doesn’t cover the hostname in the address bar | SANs, DNS results, captive portals, or the wrong site |
NET::ERR_CERT_AUTHORITY_INVALID |
The browser can’t verify the certificate chain back to a trusted root | Whether the server provides all intermediate certificates and whether HTTPS inspection is in use |
Correct the system clock, then determine whether one site or many are affected
In Windows 11, open Settings → Time & language → Date & time. Check the date and time zone, turn on Set time automatically, then select Sync now under Additional settings. On macOS, check automatic time settings under System Settings → General → Date & Time. TLS verification uses the actual time reported by the device clock; changing only the displayed time zone may not correct an inaccurate system clock.
After syncing, reopen the browser and test the original URL along with another known-good HTTPS site. If several unrelated sites report date errors, first check whether the device clock synced successfully. If only one site is affected and another device with the correct time gets the same expired certificate on a different network, contact the site administrator. If the expired certificate appears only when using a proxy, compare it with the certificate received on a direct connection; the two paths may reach different servers.
Compare direct access, system proxy, and TUN
With a standard HTTP CONNECT or SOCKS proxy, the browser still verifies the destination website’s certificate. Clash or mihomo handling your traffic doesn’t reissue certificates for websites. If errors start when you enable a proxy, investigate what changed along the route: which resolver handled the domain, which rule matched, which server the connection reached, and whether any device along the way terminated and re-established TLS.
- Establish a direct-connection baseline. On a trusted network where direct access is allowed, temporarily turn off System proxy and TUN mode in the client. Make sure the browser isn’t using a separate proxy extension, then try the original URL again. In Windows 11, check the system settings under Settings → Network & Internet → Proxy. Record the result; a direct-connection timeout doesn’t mean certificate verification succeeded.
- Enable only the system proxy. Keep TUN off. If the client’s
mixed-portis set to7890, the local proxy address is usually127.0.0.1:7890; use the port shown in the client’s current settings. In the same browser, visit the same URL. Check the client’s Connections page to confirm the request reached the core, and note the matched rule, outbound policy, and actual node, if shown. - Enable only TUN. Turn off the system proxy, then enable TUN while keeping the rule mode, node, and network unchanged as far as possible. Fully quit and reopen the browser after each change to reduce connection reuse. Note whether the error code or certificate issuer changes. If the request doesn’t appear on the Connections page, first confirm that the test traffic is using the expected entry point.
If both system proxy and TUN fail while direct access works, check the outbound and DNS settings shared by both modes. To compare, switch nodes once while keeping the mode unchanged: if only one node triggers the error, investigate that node’s route first; this doesn’t prove that the node is decrypting HTTPS. If only TUN fails, check which DNS requests it intercepts and whether the browser is still using its original DNS path.
Hostname mismatch: trace DNS and the destination server
When the browser visits www.example.org, hostname verification fails if the certificate only covers example.org. DNS interference or an incorrect local DNS entry could send the request to another server, but a misconfigured reverse proxy or a public Wi-Fi captive portal can cause similar symptoms. A hostname error confirms only that the certificate doesn’t match the requested hostname; the error code alone doesn’t prove DNS interference.
Tell apart browser, core, and proxy-side DNS resolution
First, note the browser’s Secure DNS settings. In Chrome, check Use secure DNS under Settings → Privacy and security → Security. Then inspect dns.enable and related DNS settings in the configuration the client actually loaded. Results from system lookup tools reflect only the resolver path used by those tools: the browser may use DNS over HTTPS, or hand the destination hostname to an HTTP proxy. So a correct result from a system lookup doesn’t prove the browser’s connection reached the same address.
TUN DNS hijacking is not TLS decryption
In mihomo, tun.dns-hijack redirects matching DNS traffic. For example, any:53 matches traffic on UDP port 53; to include TCP port 53, add the corresponding tcp://any:53 entry. DNS queries the browser sends over HTTPS on port 443 aren’t treated as regular DNS by these rules. Check the active configuration first; adding hijack entries isn’t a general fix for certificate errors.
If fake-ip is enabled, a result in the 198.18.0.0/16 range may be an address from the locally configured synthetic IP pool, not the website’s real address. In that case, check the destination hostname, matched rule, and outbound route in the core’s logs. Different networks returning different public IPs isn’t necessarily a problem; a CDN may assign addresses by region. More useful evidence is the certificate returned on that route and whether it covers the original hostname.
Unexpected certificate issuer: check the chain and HTTPS inspection
If one site reports an untrusted issuer across different devices and networks, the site may be missing intermediate certificates or using an issuer the browser doesn’t trust. Results can vary if some devices have an intermediate certificate cached. Send the site administrator the URL, time of the error, and certificate issuer. Avoid changing system trust settings for a single site.
If several unrelated sites fail only on the same network or device, and all show the same unfamiliar issuer, check for HTTPS inspection by a corporate gateway or security software, or a public network’s captive portal. HTTPS inspection terminates TLS in the middle and presents the browser with a reissued certificate; this is different from Clash forwarding encrypted traffic. On a managed device, ask your administrator to confirm the inspection policy and certificate deployment. On a public network, use the sign-in page provided by the operating system; don’t sign in through a certificate warning page.
Retest and report: keep the evidence needed to diagnose the issue
Change one thing at a time: correct the clock first, then switch the proxy entry point, and finally try a different outbound node. After each change, visit the original URL and confirm the warning is gone, then test a comparison site. If only the original URL starts working again, record that result; there’s no need to rewrite the entire DNS configuration.
- Describe your setup: Include your operating system and browser versions, plus the versions of both the client and its core. Different core versions may be bundled under the same client name.
- Record the differences: List the results for direct access, system proxy only, and TUN only. Include the time, error code, and certificate issuer. For issues that occur only on a specific route, add the matched rule and outbound.
- Keep logs focused: Include only relevant connection records from around the time of the error. Before sharing, remove subscription URLs, access tokens, proxy credentials, and unrelated internal hostnames.
For field definitions, see the Configuration Field Reference. If requests aren’t reaching the core or a node can’t connect, first check traffic capture and connectivity in Troubleshooting, then return to the browser to verify the certificate.