June 20, 2026 · Troubleshooting · About 11 minutes

TLS Handshake and Certificate Errors: Troubleshooting System Time, SNI, and Certificate Verification

Most certificate errors do not mean the node is down. Common causes include an incorrect system clock, a wrong SNI, or an incomplete certificate chain. This guide groups errors by message and provides safe, step-by-step fixes.

At a Glance

This guide is for v2rayN, v2rayNG, and v2flyNG users encountering TLS handshake failures, certificate name mismatches, expired certificates, or unknown authority errors. Check local time first, then the node address and SNI, certificate validity, the full certificate chain, and transport settings. Use certificate verification bypass only as a brief comparison test.

Where Does a TLS Handshake Fail?

TLS runs after the TCP connection is established and before the proxy protocol begins exchanging payload data. For a VMess or VLESS node using TLS, the client first resolves the server address and connects to the remote port, commonly 443. It then sends a ClientHello, which may include SNI, supported TLS versions, and ALPN. After the server returns its certificate chain, the local system checks certificate dates, issuer relationships, and names. Only after verification succeeds is an encrypted session established.

A failed latency test therefore does not necessarily mean that the node is unusable. DNS resolution failures, unreachable TCP ports, failed TLS certificate verification, and incorrect proxy protocol parameters can all make a test show a timeout or an unavailable status, but they occur at different points in the connection. Read the first specific error in the log before changing a parameter; this is more effective than repeatedly switching nodes.

DNS resolutionTCP connectionClient helloCertificate returnedLocal verificationEncrypted transport

If “no such host” appears before the remote address is contacted, troubleshoot DNS or a misspelled address first. If the log already contains terms such as x509, certificate, or handshake, investigate certificates and TLS. If TLS completes and the next error is invalid user, authentication failed, or protocol response, the problem is in the UUID, password, protocol type, or transport configuration—not the certificate.

Identify Certificate Errors from the Exact Log Message

In v2rayN 7.x, start by watching core output in the log area at the bottom of the main window. Open Settings → Parameter Settings to make sure the log level is not set too low. During testing, stop the current core, start it again, and visit an HTTPS page to reduce interference from old logs. In the server list, right-click the node and choose Edit Server to review the TLS and SNI fields.

On Android, start with the active configuration as well. v2rayNG uses the Xray core, while v2flyNG uses the v2fly core. Their basic rules for checking certificate validity and hostnames are the same, although log wording may differ slightly. Do not capture only the final “startup failed” line; scroll upward to find the earliest x509, tls, or certificate entry.

Error: x509: certificate has expired or is not yet valid

Cause and fix: The local clock is outside the certificate’s validity period, or the server certificate has actually expired. Sync the system date, time, and time zone first, then compare the Not Before and Not After values shown in the log.

Error: x509: certificate is valid for example.net, not edge.example.net

Cause and fix: The name being verified is not covered by the certificate. Set SNI to the certificate domain supplied by the subscription; do not fill it with a node label, CDN address, or IP address.

Error: x509: certificate signed by unknown authority

Cause and fix: The server may not be sending the complete intermediate certificate chain, or it may use an issuer chain that the local system does not trust. Test from another network first, then have the server provide the missing intermediate certificates. Do not rely on certificate verification bypass as a permanent fix.

Error: remote error: tls: handshake failure

Cause and fix: The remote server actively rejected the handshake. Check that SNI, ALPN, TLS, the port, and the transport type form a consistent set. In particular, do not mix WebSocket, gRPC, and TCP parameters.

Error: tls: failed to verify certificate

Cause and fix: This is a summary message for a verification failure. Inspect the adjacent underlying error and handle it according to whether the certificate is outside its validity period, has the wrong name, or is missing a trusted chain.

Error: context deadline exceeded

Cause and fix: The handshake did not finish before the timeout. Test DNS resolution and the remote port first, ruling out packet loss, firewall restrictions, or an incorrect port, then review the TLS parameters.

EOF, connection reset by peer, and unexpected EOF usually mean that the connection was closed prematurely; they do not by themselves prove a certificate problem. If the same node works on a mobile network but is repeatedly reset on a fixed network, compare DNS results and IPv4 and IPv6 paths first, and check whether a TCP connection can be established to remote port 443.

curl -vI --connect-timeout 8 https://node.example.net/

openssl s_client \
  -connect node.example.net:443 \
  -servername node.example.net \
  -showcerts

The command above is for independently inspecting a standard TLS site handshake. Replace the example domain with the certificate domain required by the node configuration. The subject, issuer, certificate start and end times, and Verify return code in OpenSSL output help distinguish name, validity-period, and certificate-chain problems. However, if the proxy service requires a specific path or application-layer protocol, a failed standard HTTPS request alone does not prove that the proxy entry point is unavailable.

How to Check System Time and Time Zone

A certificate contains a start time and an expiration time, and the local system uses its own clock to determine whether the current moment falls within that interval. Even when the date is correct, a wrong time zone can make the displayed time look close while the actual UTC time is off by several hours. Dual-boot systems, a powered-off motherboard clock, suspended virtual machines, and disabled automatic time synchronization are common causes.

  1. On Windows, open Settings → Time & language → Date & time. Turn on Set time automatically and Set time zone automatically, then click Sync now.
  2. On macOS, open System Settings → General → Date & Time. Enable automatic date and time, and verify the time zone.
  3. On Android, open Settings → System → Date & time. Enable network-provided time and time zone. Menu names may vary slightly between system versions.
  4. On Linux, run timedatectl status to check Universal time, RTC time, Time zone, and System clock synchronized. If necessary, run timedatectl set-ntp true to enable network time synchronization.
  5. After synchronization finishes, fully exit the client and restart the core. Do not repeat latency tests on the old connection.

Record the size of the clock error during troubleshooting instead of judging it by eye. If the local clock is 24 hours fast, a certificate that is still valid may be treated as expired. If it is 24 hours slow, a newly issued certificate may be treated as not yet valid. Some environments tolerate a very small clock difference during the handshake, but a tolerance of a few minutes should not be treated as a reliable rule.

Check Expected result Warning sign
System date The year, month, and day match the actual date The certificate appears expired or not yet valid
System time zone Matches the current region UTC time is off by several hours
Automatic time synchronization Synchronization succeeds A significant error returns after reboot
Certificate validity period The current time falls between the start and end times Multiple devices fail at the same time

Conclusion: Sync the clock before changing node fields

When several TLS nodes in the same subscription simultaneously report “expired or is not yet valid,” an incorrect local clock is usually more likely than multiple server certificates expiring at once. Syncing the clock and restarting the core is the lowest-cost first step.

How SNI, Address, Host, and the Certificate Name Relate

The node address is used for DNS resolution and the TCP connection. SNI tells the server, in the TLS ClientHello, which name the client wants to access and is often used by the core for certificate-name verification. The two values may be identical or may differ because of the entry-point architecture. Use the value from a valid subscription or server configuration; do not infer it from the node label alone.

A WebSocket configuration may also include a Host request header. Host belongs to the HTTP layer after TLS is established, while SNI belongs to the TLS handshake layer. Although both fields often contain the same domain, they are not equivalent. gRPC also uses serviceName, while REALITY may involve serverName, publicKey, and shortId; each field has a different role.

Field Stage Typical purpose What a wrong value looks like
Address DNS and TCP Locate the remote server Resolution failure, connection refusal, or timeout
Port TCP or UDP Connect to the remote listening entry point connection refused or timeout
SNI TLS ClientHello Select the certificate and verify the name Name mismatch or handshake failure
Host HTTP or WebSocket Select the application-layer virtual host An error response after TLS succeeds
ALPN TLS negotiation Negotiate h2 or http/1.1 Remote rejection or application-layer mismatch

In v2rayN, right-click the target node and choose Edit Server. First confirm that the security type is actually TLS, then check SNI. If a subscription update overwrites manual changes, return to the subscription group and inspect the original data instead of editing the value after every update. For VLESS REALITY, do not apply troubleshooting conclusions meant for ordinary public certificates; however, serverName, system time, and the related parameters still need to be consistent.

If leaving SNI blank makes the connection work, should it stay blank?

Check the original subscription configuration first. Some cores fall back to the server address when the field is blank, but that works only when the address itself is the correct certificate name. If the server explicitly provides an SNI, enter that original value.

The node address is an IP. Should SNI also be set to the IP?

Not necessarily. Public certificates are usually issued for domain names, so a node may use an IP for the connection while using a domain for SNI and name verification. Use the certificate domain supplied by the server; do not automatically copy the IP into SNI.

Must a WebSocket Host match SNI?

There is no absolute requirement. SNI determines the name and certificate at the TLS stage, while Host controls routing at the HTTP layer. An entry point may require the values to match or may require them to differ; preserve the complete subscription parameters as provided.

Can changing the port from 443 to 8443 fix a handshake failure?

Only if the server is actually listening on 8443. A port is not an optimization setting to try at random; the wrong port usually results in a connection refusal or timeout.

What should I do if a name mismatch appears after a subscription update?

Compare the address, SNI, transport, and TLS setting before and after the update. Make sure you did not select a node with the same name but different parameters. Then update the correct group again instead of continuing to use an old manually edited copy.

Incomplete Certificate Chains and Network Intermediaries

A server normally sends the site certificate along with the required intermediate certificates, and the client verifies them against root certificates in the system or core trust store. If the server sends only the site certificate, a device that has cached the intermediate certificate may work temporarily while a new device reports unknown authority. “Works on some devices” does not prove that the server chain is configured correctly.

On the same device, test the node separately over a fixed network and a mobile network. If only one network fails, compare DNS results and check whether the domain resolves to different entry points. If all networks and multiple platforms report the same certificate-chain error at the same time, a server-side configuration problem is more likely. Enterprise proxies, HTTPS inspection devices, and custom certificate environments can also change the issuer chain actually received.

Conclusion: Cross-Device Testing Quickly Separates Local and Server Problems

If the same node returns the same certificate-chain error on Windows, Android, and Linux, stop repeatedly reinstalling the client. Check the complete chain sent by the remote server and the entry-point configuration instead.

Use Certificate Verification Bypass Only for Short-Term Diagnosis

In v2rayN and related core configurations, allowInsecure permits a TLS connection to continue when certificate verification fails. It does not repair an expired certificate, incorrect SNI, or missing intermediate certificate; it only bypasses the corresponding verification result. If the connection recovers, that shows only that the failure may be in certificate verification—it does not prove that the current parameters are correct.

Use this setting for one controlled comparison: keep the address, port, protocol, transport, and routing unchanged, and toggle only certificate verification; start the core and complete one request; then restore verification and fix the time, SNI, or certificate chain based on the original log. Do not change SNI, Host, port, and allowInsecure at the same time, or the test will no longer be informative.

  1. Save a copy of the original node and record the current allowInsecure status.
  2. Confirm that the test target is clearly identified and that no other connection parameters are being changed.
  3. Enable it temporarily, restart the core, and check whether the original x509 error disappears.
  4. If the request still times out, continue checking DNS, the TCP port, the transport, and the server status.
  5. If the connection recovers, restore certificate verification immediately and fix the system time, SNI, or complete certificate chain.

Permanently bypassing verification removes a critical check of the remote identity. This is especially risky when a node address resolves to multiple entry points: the client can no longer use the certificate name and issuer chain to determine whether the connection reached the expected service. The safer approach is to keep subscription fields consistent with the server and maintain a healthy system trust store and synchronized clock.

Test result What it tells you Next step
Connection returns immediately after enabling it The failure is concentrated in certificate verification Restore verification and check the time, name, and certificate chain
Still times out after enabling it The problem is not limited to certificate verification Check DNS, the port, packet loss, and transport parameters
A protocol error appears after enabling it TLS passed, but the upper-layer configuration does not match Check the UUID, protocol, Path, Host, or serviceName
Only one network environment fails The path or resolution result may differ Compare DNS, IPv4, IPv6, and the remote entry point

A Reproducible Final Troubleshooting Order

Certificate issues are easiest to lose track of when several parameters change at once. Keep the node and network fixed, record the time, and use the first underlying log error as the baseline. Restart the core and repeat the same request after each step so the results remain comparable.

  1. Confirm the system time: Sync the date, time zone, and network time. The error should be reduced to seconds, not minutes or hours.
  2. Confirm the resolution result: Check that the node domain resolves and determine whether IPv4 and IPv6 point to the expected entry point.
  3. Confirm the TCP port: Check the 443, 8443, or other explicitly specified port in the subscription; do not replace it arbitrarily.
  4. Confirm the TLS setting: Enable TLS when the node requires it; do not force TLS onto a non-TLS entry point.
  5. Confirm SNI: Use the certificate name provided by the subscription, distinguishing the node address, label, Host, and serviceName.
  6. Confirm the certificate validity period: Compare the current UTC time with the certificate’s start and end times to determine whether the issue is the local clock or an expired server certificate.
  7. Confirm the certificate chain: Check whether the server sends the required intermediate certificates, and compare results across multiple platforms.
  8. Confirm the transport parameters: WebSocket Path and Host, gRPC serviceName, and the relevant REALITY fields must be kept consistent as a set.
  9. Run a short comparison test: Switch allowInsecure only during diagnosis, and restore certificate verification when testing is complete.
  10. Return to the original subscription: If manual edits keep accumulating, re-import the correct group and retain only one test configuration.

After these steps, the error usually falls into one of three clear categories: an abnormal local clock or trust environment, a mismatch between node fields and the entry point, or an abnormal server certificate or listener configuration. Only the first category can be fixed directly on the local machine; the second requires restoring the correct subscription parameters; the third requires the server operator to renew the certificate, complete the certificate chain, or correct the entry-point configuration.

Conclusion: Handle Certificate Errors by Their Position in the Connection

Use the logs to distinguish DNS, TCP, TLS, and proxy-protocol failures, then check them in this order: time → SNI → validity period → certificate chain → transport parameters. Use verification bypass only once as a controlled diagnostic variable, never as the final configuration.

Download Client