At a glance

For troubleshooting standard TLS nodes in v2rayN, v2rayNG, and v2flyNG: use the logs to identify where the connection stops, then check the system clock, server address, SNI, and certificate chain in order. This guide covers client-side checks and common error messages to help distinguish local configuration issues from server-side certificate problems. It also explains why allowInsecure is not a safe long-term fix.

1. TLS Handshake Failures: Identify the Connection Stage First

The GUI client stores nodes and generates configuration; the actual connection is made by a core such as Xray or V2Fly. v2rayNG uses the Xray core, while v2flyNG uses the V2Fly core. For v2rayN, check the active configuration and logs to identify the core in use. Log prefixes can vary by core and version, so follow the error chain to its last relevant detail rather than relying on a generic “connection failed” message.

For a VLESS, VMess, or Trojan node with TLS enabled, the client typically resolves the server address, connects to the remote TCP port, and then starts the TLS handshake. Only after that succeeds does proxy protocol negotiation begin. The protocol name alone does not confirm that standard TLS is enabled, so check the transport security settings. REALITY has its own parameters and validation mechanisms; do not apply the certificate troubleshooting steps in this guide to it.

Log clueLikely stageCheck first
no such hostAddress resolutionServer address spelling, DNS response
connection refusedTCP connectionRemote listening port, firewall, service status
x509:Certificate verificationDevice clock, certificate name, trust chain
tls: handshake failureTLS negotiationSNI, TLS service configuration, server logs
EOF or i/o timeoutRequires contextWhether the error occurs before or after the handshake

For example, if the remote port is set to 443 but connection refused appears before the handshake starts, changing certificate settings will not help. 443 is a common port, not a substitute for the port specified by the service provider. The local proxy port is not the remote port to enter here.

2. System Clock and Certificate Validity: Correct the Device Clock First

Certificates have a validity start date and expiration date. The client uses the device's current time to determine whether a certificate is valid. If the date is reset to the past, the certificate may appear “not yet valid”; if it jumps into the future, it may appear “expired.” Make sure the displayed time matches the actual time. Changing the time zone alone usually will not fix an incorrect system clock.

  1. Note the error

    Find the error for this connection in the client log and note the current time and any certificate validity details. Stop repeated tests for now to keep old and new log entries from getting mixed together.

  2. Sync the clock

    On Windows 11, go to Settings → Time & language → Date & time, turn on Set time automatically, then select Sync now. Make sure the device has a working network connection first.

  3. Check Android

    On stock Android, go to Settings → System → Date & time and turn on Set time automatically. Menu names vary by manufacturer; search Settings for “Date & time” and confirm automatic time is enabled and working.

  4. Reconnect

    Return to the client, reconnect once, and check the new log. If the device clock is correct and the certificate has actually expired, the server operator must renew and reload the certificate. Do not keep changing the client date.

Certificate validity has a hard cutoff; there is no universal grace period such as “five minutes of clock skew.” For example, if a certificate becomes valid at 00:00 UTC and the device clock is 23:50 the previous day, verification may fail. Logs and certificate tools may display times in different time zones, so convert them to UTC or the same local time zone before comparing.

3. Server Address, SNI, and Certificate Name: What Goes in Each Field

The server address determines where the client connects. SNI is the hostname sent to the server during the TLS handshake; the server may use it to select a site and certificate. In common core configurations, serverName also specifies the server name to verify, so it is not a free-form note.

Suppose the service provider specifies edge.example.com as the connection address, 443 as the remote port, and tls.example.com as the TLS name. Enter each value in its own field. The address and TLS name can differ, but only if the server is configured to support that combination. Never pick an SNI hostname at random from search results.

Wildcard certificates have limits too: *.example.com typically matches node.example.com, but does not necessarily cover example.com or a.node.example.com. If you change the server address to an IP and do not set an expected name, the core may try to verify that IP. A certificate with only a DNS name in its SAN will not pass that check.

Bottom line: Use the server-provided parameters to verify names; don't guess the SNI from the address

If the connection address is an IP but the certificate is issued to a hostname, make sure you have the server-provided serverName. Keep the correct connection address and set the expected name covered by the certificate. This is more reliable than disabling certificate verification.

4. Common Certificate Errors: Diagnose from the Exact Message

Here are common key phrases from logs. The full message may also include an outbound name, connection ID, or address. Do not assume the last generic message in the log is the sole cause. For certificate errors, preserve the full explanation after x509. Before sending logs to the service provider, redact subscription tokens, user IDs, and personal addresses.

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

Cause: The device clock is incorrect, or the server certificate is genuinely outside its validity period. Fix: Sync the device clock first, then compare it with the validity dates in the log. If the clock is correct, the server operator must renew the certificate or correct its deployment.

Error: x509: certificate signed by unknown authority

Cause: The certificate chain cannot be traced to a root certificate trusted by the client. The server may be missing an intermediate certificate, using a self-signed certificate, or the device's trust store may have a problem. Fix: Ask the service provider to check the complete certificate chain and update the system trust store. Do not install root certificates from unknown sources.

Error: x509: certificate is valid for

Cause: The rest of the message usually lists the names covered by the certificate and the name that failed to match. Fix: Check the node's serverName against the certificate SAN. If an incorrect SNI caused the server to return its default site certificate, the virtual host configuration also needs to be corrected.

Error: tls: first record does not look like a TLS handshake

Cause: The response on the selected port does not look like TLS, often because the client connected to a plaintext service. Fix: Check the remote port, security settings, and reverse proxy entry point. Changing certificate verification settings will not fix a port mismatch.

Error: remote error: tls: handshake failure

Cause: The remote end rejected TLS negotiation. Possible factors include SNI, the protocol version, or server policy; this message alone does not prove that the certificate has expired. Fix: Restore the TLS parameters provided by the service provider and compare them with server logs from the same time.

An EOF by itself does not mean the certificate is untrusted. The remote end may have closed the connection early, the entry point may be misconfigured, or a network device may have interrupted the connection. Look for earlier TLS details first, then decide whether you need help from the service provider.

5. What allowInsecure Does and Where Its Risks Begin

In common standard TLS configurations, allowInsecure controls whether the server certificate is verified. It is not a general-purpose “compatibility” switch. If verification is skipped, the client may no longer reject a connection when it is redirected to the wrong server or intercepted by a man-in-the-middle. Encryption alone does not reliably confirm the identity of the other end.

The example below shows only the TLS fields inside the core outbound streamSettings; it is not a complete node configuration you can import. tls.example.com is an illustrative hostname. Use only the TLS name explicitly provided by the service operator. GUI clients usually generate these fields, so make changes through the node editor whenever possible.

{
  "security": "tls",
  "tlsSettings": {
    "serverName": "tls.example.com",
    "allowInsecure": false
  }
}

6. Check v2rayN and v2rayNG in This Order

Interface labels vary by version, so note the client and active core versions before troubleshooting. In a typical setup, double-click the target node in the v2rayN server list, or tap the edit icon beside the target configuration in v2rayNG. Check the address, port, security layer, SNI, and certificate verification status for that same node. Do not confuse global settings with per-node settings.

  1. Select one node

    Choose just one node to troubleshoot and note its remark and source group. Confirm that the log belongs to this node, not another outbound selected by automatic switching.

  2. Check the endpoint

    Compare each setting in the node editor with the service provider's parameters: server address, remote port, transport, and whether the security layer is TLS. The example port 443 is not a substitute for the actual configured value.

  3. Check the name

    Check the “SNI” or “serverName” field. Make sure it has no scheme, port, or leading or trailing spaces. If there is also a Host field, fill it in separately as specified by the service provider; do not use one in place of the other.

  4. Keep verification enabled

    Turn off “Skip certificate verification” or any equivalent option, then save. Return to the main screen and reconnect. If needed, use the client's core restart option to apply the change.

  5. Compare the logs

    Make one real request and compare the errors before and after the change. If the TLS error disappears but an authentication or transport error appears, check the user ID, path, and server-side protocol parameters next.

Subscription nodes can be overwritten on update: changes made directly to a subscription-generated entry may be replaced the next time it refreshes. For troubleshooting, duplicate it as a standalone entry if the client supports that, and label it clearly. For a lasting fix, ask the service provider to correct the subscription parameters. Do not post a complete node export, raw JSON, or subscription URL in a public help forum.

7. FAQ: Why Does the Client Fail When the Browser Works?

The browser opens the same domain, but the node still reports a certificate error. Why?

First compare the domain opened in the browser with the node's serverName, then check the port. The browser and core may use different trust sources or build certificate chains differently. A webpage loading successfully does not rule out a missing intermediate certificate; ask the service provider to check the actual TLS entry point.

Why do I get a certificate name mismatch after changing the server address to an IP?

Keep the connection IP allowed by the service provider and check whether TLS serverName needs to be set separately. A hostname certificate usually cannot verify an arbitrary IP. Do not change SNI to the IP just because you changed the connection address.

Why does the certificate still appear expired after syncing the clock?

Check the new log after syncing and verify the certificate's expiration time. If it has genuinely expired, the server operator must renew it, reload the service, and confirm that the entry point is serving the new certificate. A renewal marked successful in the control panel does not guarantee that the running service has loaded it.

It works when I skip verification. Can I leave it enabled?

Not as a daily setting. Note what happened, restore verification, and continue checking for a clock error, name mismatch, or broken trust chain. If the problem is server-side, send the service provider the accurate time, core version, and a redacted x509 error.

Does a REALITY node also need a certificate hostname?

Do not use the standard TLS certificate troubleshooting process. First confirm that the security layer is actually REALITY, then check serverName, the public key, shortId, and other fields against the server parameters. Also check that the client and core support them. Do not switch to TLS without authorization.

Bottom line: Change one setting at a time and keep verification enabled

Work in this order: clock → endpoint → name → certificate chain. Reconnect and save a fresh log after each change. Once TLS verification passes, check the proxy protocol and routing; this keeps problems from separate stages from getting mixed together.