Troubleshooting 7 min read

HTTPS Certificate Errors When Using a Proxy: Common Causes

Learn how system time, DNS issues, HTTPS inspection, and misconfigured proxy rules can trigger certificate errors—and how to troubleshoot them step by step.

Certificate Error Codes: Tell Validation Failures from Connection Failures

Seeing a certificate warning for the first time after enabling a proxy doesn’t mean Clash replaced the website’s certificate. When a browser accesses HTTPS through an HTTP proxy, it typically opens a tunnel with CONNECT, then performs the TLS handshake with the destination site through that tunnel. TUN mode intercepts traffic at the network layer; enabling it alone does not cause certificates to be issued for websites. More commonly, switching proxies changes the route, the DNS resolver in use, or the server that receives the request.

First, note the full hostname in the address bar and the error code. If the browser lets you view the certificate details, note the issuer, validity period, and Subject Alternative Names (SANs)—without proceeding to the site. The message “Your connection is not private” alone doesn’t tell you what to check next.

Common Chrome errorsCheck first
NET::ERR_CERT_DATE_INVALIDIs the device clock correct? Is the certificate not yet valid or already expired?
NET::ERR_CERT_COMMON_NAME_INVALIDDoes the certificate’s SAN cover the hostname in the address bar? If not, check DNS, captive portals, and server configuration.
NET::ERR_CERT_AUTHORITY_INVALIDDoes the certificate chain lead to a trusted root? Check whether the site is missing an intermediate certificate or HTTPS inspection is taking place along the route.
ERR_PROXY_CONNECTION_FAILEDCan the browser connect to the configured proxy address and port? This error does not, by itself, indicate a website certificate validation failure.

System Time: Multiple Sites Report Validity Errors

If several sites that normally work suddenly report date errors—especially after the device has been off for a long time, resumed from sleep, or restored from a VM snapshot—check the system clock first. Browsers compare the certificate’s validity dates with the device’s current time. If the date is a day behind, a newly issued certificate may appear “not yet valid.” Check the displayed time zone too, but the comparison uses the actual time represented by the system clock.

  1. Windows 11: Open Settings → Time & language → Date & time. Turn on “Set time automatically,” then select “Sync now” under Additional settings. Check the current date, time, and time zone.
  2. macOS: Open System Settings → General → Date & Time and check that automatic date and time are enabled. If you can’t change this setting on a managed computer, contact your administrator.
  3. Recheck the original URL: After syncing, reopen the original URL in a new window and test another HTTPS site that normally works. If only the original site still fails, check the validity dates on the certificate it currently presents. There’s no need to keep reinstalling the client.

DNS and Captive Portals: The Certificate Name Doesn’t Match

A hostname mismatch means the certificate presented doesn’t prove the identity of the hostname in the address bar. For example, if you visit example.com but the certificate lists only login.example.net, the browser rejects it. DNS hijacking or misconfiguration can send a request to the wrong server. A public Wi-Fi captive portal, a site’s reverse proxy, or a CDN misconfiguration can cause the same warning. A hostname mismatch alone isn’t proof of DNS hijacking.

Check Which DNS Resolution Path the Client Actually Uses

A DNS lookup from a regular terminal shows only the answer returned for that particular query. The browser may use secure DNS, the system may have DNS intercepted by TUN, or a remote server may resolve the hostname when certain proxy protocols are used. If mihomo uses fake-ip, a local lookup returning an address such as 198.18.0.1 may just be a mapping assigned by the core—not the website’s public IP. Different routes may also resolve to different CDN addresses. The key question is which route returns a certificate that doesn’t match the same hostname.

  • Just joined public Wi-Fi? Check whether the system prompts you to sign in to the network. Complete authentication through the system-provided portal, then retry the original HTTPS address.
  • Only one route fails? If permitted, retry the same hostname on the same device and browser using another trusted network, then compare the certificate’s SANs and issuer. Don’t enter a resolved IP directly in the address bar to check the certificate: that changes the name the browser validates and may cause the server to present a different certificate.
  • Several trusted routes fail? Keep the hostname and certificate details, then report them to the site administrator so they can check the certificate binding for that domain or the CDN configuration.

HTTPS Inspection: The Issuer Is a Company or Security Product

A corporate gateway, endpoint security product, or debugging tool with HTTPS decryption enabled may create two TLS connections: one between the browser and the inspection device, and another between that device and the website. The browser sees a certificate issued by the inspection device for the site. If the required organizational root certificate is missing from the device, or the intermediate certificate chain is incomplete, the browser may report an untrusted issuer.

Compare the certificate on the failing route with one from a known-good route. If several unrelated sites show the same unfamiliar issuer only on the failing route, check for HTTPS inspection first. On the other hand, if only one site fails and the issuer is expected, ask the site operator to check its certificate chain. The issuer name is a clue, not proof—public sites also renew certificates or change certificate authorities.

  • Managed devices: Give your administrator the error code, issuer, affected sites, and time of the issue. Confirm the trust configuration through an organization-approved process; don’t import certificates yourself.
  • Personal devices: Check whether you recently enabled HTTPS decryption or a debugging feature. If you don’t recognize the issuer, avoid accessing sensitive accounts on that network for now. Verify using a trusted network and, if needed, ask the network provider about it.

Clash Rules and TUN: Find the Route Your Request Actually Takes

A misconfigured rule won’t turn a valid website certificate into an invalid one, but it can send a request through the wrong exit. For example, sending an internal corporate hostname to a public proxy node may prevent a connection or reach an endpoint that presents a different certificate. Conversely, a hostname that should use a proxy may match DIRECT and continue over a direct connection. In rule mode, the first matching rule usually applies. If a broad rule appears too early, a more specific hostname rule may never match.

Change One Setting at a Time

  1. Capture the current state first: Note the configuration name, client mode, and whether the system proxy and TUN are enabled. Turning off the system proxy doesn’t turn off TUN; browser extensions may also configure a separate proxy.
  2. Check the same request: In the client’s Connections or Logs panel, search by reproduction time and destination hostname. Check the matching rule, the exit currently selected in the policy group, and the destination port. Standard HTTPS uses 443 by default; if the URL specifies another port, use that instead. If you see only an IP address or no record, don’t assume a hostname rule matched.
  3. Keep the mode fixed, then switch routes: If your network policy allows it, keep the same configuration, browser, and hostname, and switch only the exit selected in the current policy group. Then compare the certificate details. To check whether traffic is passing through the client, also verify the system proxy, TUN, and any browser-specific proxy settings. Otherwise, a request that’s still being intercepted may be mistaken for a direct connection.

If web pages load but subscription updates fail with a TLS error, troubleshoot the subscription server separately. The updater may use a different network route and trust settings from the browser; being able to open websites doesn’t mean subscription requests will work. Record only the subscription hostname and error code. Don’t include the full subscription URL in screenshots, logs, or support tickets.

Troubleshooting Order: Narrow It Down with Minimal Changes

  1. Start with the error code. If you can’t connect to the local proxy, check its listening address and port. Only troubleshoot certificates once a website certificate has been received.
  2. If several sites report date errors, check the clock first. If only one site fails, check the validity dates and hostname on the certificate it presents.
  3. If the hostname doesn’t match, compare network routes. Check for a captive portal first, then compare the same hostname across routes. If the issuer looks unusual, check for HTTPS inspection and verify the certificate trust chain.
  4. If it fails only when Clash handles traffic, check the rule match. Compare the mode, rules, exit, and certificate details, changing only one thing at a time. If both routes receive the same problematic certificate, contact the site operator or device administrator instead of continuing to switch nodes.
Download the Latest Clash Version