Clash HTTPS Certificate Errors When Using a Proxy: Causes and Troubleshooting
Proxy-related browser certificate errors can stem from an incorrect system clock, DNS hijacking in TUN mode, leftover MITM settings, or network equipment. This guide walks through each check in order.
Note the error code, then compare proxy modes
System proxy and TUN modes usually change only the connection route; they do not issue certificates for websites. If your browser reports a certificate error, it has rejected the certificate it received. First, note the full hostname in the address bar and the error code. If certificate details are available, record the issuer, validity period, and Subject Alternative Names (SANs). For example, a certificate covering only example.com will not pass validation for www.example.com.
| Error code | Check first |
|---|---|
NET::ERR_CERT_DATE_INVALID | System clock and the certificate's validity dates. |
NET::ERR_CERT_COMMON_NAME_INVALID | Whether the certificate SAN covers the hostname, and whether you reached a sign-in portal or another server. |
NET::ERR_CERT_AUTHORITY_INVALID | Whether the issuer is trusted, the certificate chain is complete, and HTTPS inspection is in use. |
- If your device and network policies allow it, turn off both the client's system proxy and TUN, then test the same publicly accessible URL with a direct connection. If the site cannot be reached directly, note “direct connection unavailable”; don't treat that result as a clean certificate check.
- Enable only the system proxy and visit the same URL. Make sure browser proxy extensions or separate proxy settings aren't interfering with the test. If the client lists
7890as its mixed port, the local proxy should point to127.0.0.1:7890; use the port shown by your client. - Turn off the system proxy, enable only TUN, and test again. After each change, fully quit and reopen the browser to reduce the chance of reusing existing connections. Note the hostname, matched rule, and outbound policy when the error occurs. Don't update subscriptions or switch nodes during testing.
Incorrect date or time: check the system clock and certificate validity
If several sites report expired or not-yet-valid certificates, check the device clock first. On Windows 11, open Settings → Time & language → Date & time, check the time zone, turn on Set time automatically, then select Sync now. On macOS, open System Settings → General → Date & Time and check the system time and time zone. If the issue began just after enabling a proxy, the device may simply not have synced its clock after waking from sleep.
- Check the certificate's “Valid from” and “Valid to” dates. If the times are shown in UTC, add 8 hours to compare them with Beijing time. Checking only the date can miss the exact time the certificate becomes valid.
- After syncing the clock, if only one site still reports an error and both direct and proxied connections receive the same expired certificate, note the hostname and expiry date and contact the site's administrator. Don't set the system clock back to make the certificate appear valid.
- If the proxy route receives an expired certificate but a direct connection does not, record the issuer and validity dates for both. The difference could be due to separate site endpoints or an inspection device along the proxy route; the error code alone can't identify the cause.
Errors only in TUN mode: check DNS handling and rule routing
mihomo TUN can take over DNS queries, depending on the configuration. tun.dns-hijack sends matching DNS traffic to the core for handling; it does not mean HTTPS connections are decrypted. With fake-ip mode enabled, DNS queries may also return synthetic addresses in 198.18.0.0/16, depending on the configuration. Under normal conditions, the core uses its mappings to recover the hostname and apply rules. Seeing a synthetic address alone does not point to a certificate problem.
Check the hostname, DNS resolution path, and outbound route
- Start with the hostname. If the certificate is issued for a different hostname, note the name shown on it. A corporate intranet hostname may require internal DNS to reach the correct endpoint; a public resolver might return an external address or no record at all. Compare the certificate with one received in a working mode. Don't replace the hostname with an IP address: connecting by IP can also trigger a name mismatch.
- Next, check the DNS resolution path. Review
dns.enhanced-mode,nameserver-policy, andtun.dns-hijackin the active configuration. Use your system's DNS tools to record the results, but don't assume the browser uses the same path. Secure DNS in the browser may send queries over HTTPS; intercepting port 53 alone does not intercept those requests. - Finally, check the outbound route. In the client's Connections or Logs view, search for the hostname and compare the matched rule and policy in system proxy and TUN modes. If the failing mode sends an intranet hostname through an unintended outbound, check that the hostname-specific rule comes before broader rules and that the selected outbound can reach the internal endpoint. A
DIRECTmatch means the connection goes out directly; it doesn't mean DNS automatically switches to a system or corporate server.
If DNS results still look stale after changing the configuration, run ipconfig /flushdns on Windows to clear the system DNS cache, then fully restart the browser. This command does not clear caches maintained by the browser or mihomo. When changing DNS settings, keep a copy of the current configuration, change one setting at a time, and retest. For internal hostnames, follow the DNS policy provided by your administrator.
Unexpected certificate issuer: check HTTPS inspection tools and network equipment
Debugging proxies, security software, and corporate gateways may inspect HTTPS traffic in managed environments, issuing replacement certificates for visited hostnames through a local or corporate certificate authority. Standard Clash forwarding does not require installing a root certificate in the browser. If you've used a packet-capture tool, check not only certificates but also whether the tool still occupies a proxy port or left a manual proxy or auto-configuration script enabled. A leftover root certificate by itself does not actively replace website certificates.
- Only one personal device is affected: On Windows 11, go to Settings → Network & Internet → Proxy and check whether the setup script and manual proxy point to the intended client. Then check browser extensions and debugging-tool processes. If you find a debugging setting you left behind, remove it using the tool's uninstall instructions. Don't bulk-delete root certificates.
- Multiple devices on the same Wi-Fi are affected: If permitted, compare using a mobile hotspot. If the same unfamiliar issuer or portal hostname appears only on the original Wi-Fi, check for a network sign-in prompt or contact the network administrator. Don't enter portal credentials on an arbitrary HTTPS warning page.
- Only one proxy node is affected: Keep the hostname, proxy mode, and local configuration the same, and switch to a known-working node. If the error disappears and the issuer or hostname also changes, stop using the affected node and note the differences. A different exit route may also send the request to another site endpoint; this evidence alone does not prove that the node is decrypting traffic.
Retest after the fix: distinguish website certificates from core handshake errors
A browser certificate warning and x509: certificate signed by unknown authority in the client logs may not refer to the same connection. The browser warning applies to the page connection; the core log may refer to a TLS handshake with the proxy server or to HTTPS requests handled by the core, such as encrypted DNS. If the page only reports a connection failure and the certificate error appears only in the logs, first identify the log source using its timestamp, remote address, and component, then contact the party responsible for that connection.
- Restore your usual proxy mode and reopen the URL that originally failed. Check that the address bar still shows the original hostname, the browser no longer reports an error, and the issuer, hostname coverage, and validity dates are correct.
- Test another publicly accessible site. If you also rely on a corporate intranet, test an approved internal site as well. Make sure the fix hasn't sent public sites or internal hostnames down the wrong route.
- If the issue persists, include the browser and client versions, proxy mode, full error code, time of occurrence, and certificate issuer when reporting it. If you attach logs, redact subscription links, credentials, and internal addresses. Explain which comparison reproduces the issue so the maintainer can determine whether to investigate the device, node, or site's certificate chain.