This guide covers certificate verification failures and interrupted TLS handshakes in v2rayN, v2rayNG, and v2flyNG. Use the logs to distinguish clock, hostname, and trust-chain errors, then check the node’s server address, SNI, and transport Host. Troubleshoot standard TLS and REALITY separately. Change one field at a time, keep certificate verification enabled, and confirm recovery with a real connection.
1. Start with the logs: a certificate error doesn’t mean the port is unreachable
The TLS handshake happens after the transport connection is established. A successful TCP connection only shows that the destination port responds; it doesn’t prove the certificate is trusted, the hostname matches, or proxy authentication succeeded. It’s possible for TCPing in v2rayN to succeed while a real connection test fails. Don’t keep changing the local proxy port as a result.
Note the client name and version, the core version actually in use, the node’s security type, and when the failure occurred. Stop repeated background tests and try connecting to just one node once. In the logs, find the most specific error from that same time. An outer error like failed to find an available destination is only a summary; check the details that follow it.
Error: x509: certificate has expired or is not yet valid
Cause: The device clock is outside the certificate’s validity period, or the server certificate has actually expired. Fix: Sync the device clock, then check the certificate’s validity dates. If the clock is correct and the error persists, the server operator needs to renew the certificate or fix its deployment.
Error: x509: certificate signed by unknown authority
Cause: The certificate chain can’t be established. Common causes include a missing intermediate certificate, a self-signed certificate, or certificate replacement somewhere on the network. Fix: Check the issuer and full certificate chain. Don’t simply disable verification.
Error: remote error: tls: handshake failure
Cause: The remote server rejected the handshake. Possible causes include SNI, the protocol version, a required client certificate, or server policy. Fix: Check the required security type and SNI first, then consult the server logs. This error alone doesn’t mean the certificate has expired.
2. Sync the system clock: check the date, time zone, and certificate validity
Certificates have notBefore and notAfter dates. Validation uses the absolute time from the system clock, not just the hour shown in the taskbar. Changing the time zone while keeping the absolute time correct usually won’t invalidate a certificate. Manually setting the local clock to a time in another time zone, however, can create an offset of several hours.
-
Check the date
First, confirm the year, month, and day are correct. After a long shutdown, restoring a snapshot, or a motherboard clock problem, a device may revert to an earlier date. Don’t just adjust the minutes until the time looks close.
-
Sync the desktop clock
On Windows 11, go to Settings → Time & language → Date & time, turn on Set time automatically, check the time zone, then select Sync now. On macOS, go to System Settings → General → Date & Time and turn on automatic date and time.
-
Sync the Android clock
On Android, this is usually under Settings → System → Date & time. Turn on automatic time and automatic time zone. Menu names vary by device; search Settings for “date and time” if needed.
-
Retry and record the result
Once the clock has synced, reconnect with the client. If the certificate still appears expired, record the current time shown in the error and the certificate’s validity period. Ask the node operator to check the certificate actually served by the server.
On Windows, run w32tm /query /status in a terminal to check time synchronization. The sync command w32tm /resync usually requires administrator privileges and depends on the Windows Time service. If it fails, check the service and network; running the command doesn’t mean the clock synced. On Linux, use timedatectl status to check the system clock and time synchronization service. How to enable synchronization depends on the distribution.
Bottom line: if the clock is correct and the certificate still appears expired, check the server
If synchronization succeeds and the current date in the error is correct, stop adjusting the device clock. Ask the operator to check certificate renewal, service reloads, and whether any server endpoint is still serving an old certificate.
3. Check SNI, server address, and Host separately
SNI is an extension in the TLS ClientHello that indicates the target hostname. In client settings, serverName is commonly used for both the handshake name and certificate hostname verification, depending on the core. It must match the server’s requirements and be covered by a hostname in the certificate’s SANs. “Masking domain” isn’t a standardized protocol field; first confirm whether the provider means SNI, the WebSocket Host, or another transport parameter.
| Field | Purpose | What to check |
|---|---|---|
| Server address and port | Specify the server endpoint to connect to | May be a hostname or IP; use the port provided for the node |
| SNI / serverName | TLS handshake name and, typically, the name used for certificate verification | Enter a hostname only—no scheme, path, or port |
| WebSocket Host | HTTP Host header in the WebSocket handshake | Must match the routing configuration of the reverse proxy or upstream site |
| WebSocket path | WebSocket request path | Keep the leading slash; a path error usually isn’t a certificate hostname error |
A server address can be an IP while SNI is a hostname; this can be a valid setup. For example, you can connect directly to an IP while using a hostname for TLS verification. Conversely, removing SNI may cause the client to verify the certificate against the IP. If the certificate only contains hostnames, this can result in cannot validate certificate ... because it doesn't contain any IP SANs. Don’t assume that a different address and SNI mean the configuration is wrong.
- In v2rayN, double-click the node in the main window to open its editor. Check the address, port, transport security, and SNI, and record the original values before saving. Labels vary by version; SNI may be shown as Server name.
- In v2rayNG and v2flyNG, tap the edit button for the node in the list and expand the transport or TLS settings to check the relevant fields. Change only the selected node; don’t alter global routing at the same time.
- SNI should be a hostname such as
example.com, nothttps://example.com:443/path. The domain here is only an example of the format; use the value from your node configuration. - A wildcard certificate for
*.example.comusually matchesa.example.com, but not the apex domainexample.comor a deeper subdomain such asa.b.example.com.
The snippet below illustrates part of a standard TLS configuration. It isn’t a complete, connectable node and doesn’t apply to REALITY. Keep the node’s actual transport type unchanged; the example omits the server address, authentication, and other outbound fields.
{
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"serverName": "example.com",
"allowInsecure": false
}
}
}
4. allowInsecure: don’t use it to work around certificate problems
Setting allowInsecure to true skips standard server certificate verification. UI options such as “Allow insecure connections” or “Skip certificate verification” usually do the same. TLS encryption may still be in use, but the client can no longer confirm the server’s identity through normal certificate-chain and hostname checks. This isn’t a general-purpose compatibility setting.
Symptom: the connection works after verification is disabled
Cause: The issue may be the certificate’s validity period, hostname match, or trust chain—not network quality. Fix: Re-enable verification and fix the relevant certificate issue. This result doesn’t prove the server’s identity is trustworthy.
Symptom: the handshake still fails after verification is disabled
Cause: The failure may happen before certificate verification—for example, the port isn’t serving TLS, the server rejects the SNI, or the security type is wrong. Fix: Recheck the address, port, and handshake settings. Don’t keep adding insecure options.
- Publicly trusted certificate: The server should provide the leaf certificate and any required intermediate certificates. Keep verification enabled in the client.
- Private certificate authority: Deploy a trusted root or supported certificate constraints only when you control the certificate source and are following your organization’s policy. Never install a root certificate just because an unfamiliar prompt asks you to.
- Outdated system trust store: Check for system updates and review the trusted root certificates. Importing an unknown certificate shouldn’t be your first step.
5. Fingerprints and REALITY: troubleshoot according to the core in use
A client fingerprint describes TLS handshake characteristics; it isn’t a certificate hostname or a verification bypass. In Xray configurations that support the feature, fingerprint may use values such as chrome. Changing it won’t make an expired certificate valid again or add a missing hostname to the certificate’s SANs.
| Configuration type | Check first | Don’t mix with |
|---|---|---|
| Standard TLS | Device clock, serverName, certificate validity, and the full certificate chain | Don’t substitute REALITY public key parameters for certificate settings |
| REALITY | serverName, server public key, shortId, fingerprint, and server requirements | Don’t apply the standard TLS approach of disabling certificate verification |
| Node without TLS | First confirm whether the error comes from a subscription update, a test target, or a different connection | Don’t enable TLS on the existing node without a reason |
v2rayNG uses the Xray core, while v2flyNG uses the V2Fly core; their features and fields aren’t interchangeable. In v2rayN, check which core the current node actually uses. For REALITY or XTLS Vision, first confirm that the selected core supports those features. Being able to import a link doesn’t mean every parameter is supported or active.
- Standard TLS: Keep the existing fingerprint setting and fix the clock and SNI first. Test a supported fingerprint only if the logs or server requirements point to a handshake compatibility issue.
- REALITY: Check the server name, public key, and shortId against the provider’s values, character for character. Also check the device clock; if the server enforces a time-difference limit, an incorrect clock can affect authentication.
- VLESS flow is a separate configuration layer. If the node requires
xtls-rprx-vision, match the server setting. Changing the flow won’t fix a standard TLS certificate hostname error.
6. Diagnose with a TLS handshake tool: port, certificate chain, and server
If OpenSSL is installed, use it to inspect the certificate presented by a standard TLS endpoint. In the command below, example.com is a format example; replace it with the actual endpoint and the SNI required by the server. Use the node’s configured port as well. This test checks only the TLS layer; it doesn’t verify VMess or VLESS authentication.
openssl s_client -connect example.com:443 -servername example.com -showcerts -verify_hostname example.com -verify_return_error
- Check the certificate’s validity period, SANs, and issuer. Confirm that the certificate belongs to the target service, not a gateway, login page, or another site.
- Check the verification result and error details. Tools and clients may use different trust stores, so a successful tool test is only a diagnostic clue; retest in the client.
- If the connection closes before the certificate is returned, check that the port is a TLS endpoint, that the SNI is allowed, and that any upstream proxy is configured to forward the connection correctly.
- If the certificate changes when you switch to a trusted network, check whether a network device or security software is replacing it. Don’t accept a new certificate when its source is unknown.
- A standard OpenSSL probe can’t verify REALITY-specific authentication parameters. Troubleshoot REALITY using the client core and server logs.
Bottom line: a successful tool test confirms only that particular TLS check
If certificate verification succeeds but the proxy still fails, check the transport path, authentication parameters, and server inbound configuration. Don’t keep changing SNI once it’s verified, and don’t assume every post-handshake failure is a certificate issue.
7. Verify the fix and answers to common questions
After each change, save the node and establish a new connection; existing long-lived connections may not pick up new settings right away. Verify in this order: the core starts correctly → the node handshake succeeds → a real request works. If the client logs no longer show certificate errors but the browser still has problems, check the system proxy, the app’s proxy settings, and routing rules. Don’t expand the investigation back to every TLS setting.
- Confirm automatic time synchronization succeeded and the date remains correct after restarting the device.
- Confirm SNI matches the server’s requirements, certificate verification is enabled, and the transport Host and path haven’t been changed accidentally.
- Select the repaired node, run one real connection test, then use an app with the proxy configured correctly to access an actual destination.
- Record the fields changed and the result. If the configuration came from a subscription, ask the provider to fix the source data so the next update doesn’t overwrite your local changes.
A certificate error during a subscription update—does that mean the node’s SNI is wrong?
Not necessarily. A subscription update is an HTTPS request from the client to the subscription URL. It verifies the subscription site’s certificate and usually doesn’t use the SNI in the node editor. First determine whether the error occurred during “Update subscription” or “Connect to node,” then check the relevant hostname, system clock, and trust chain.
If the same node works on another device, does that rule out a server problem?
Not completely. The devices may resolve to different endpoints or use different trust stores, cores, or clock settings. Compare the actual server address, SNI, certificate issuer, and expiration date first, then compare settings one at a time. Don’t copy all system settings wholesale.
Why does the client still fail if the masking domain opens in a browser?
The browser may connect to a different address, use a different trust store, or take a different transport path. Loading the page only proves that one browser request succeeded. The client still needs to connect using the address, port, SNI, transport settings, and authentication parameters specified for the node.