This guide is for users who have received Trojan settings from their own provider and want to add or check them manually in Shadowrocket. It explains the difference between Address and SNI, how to enter Port and Password, when to use Allow Insecure, and how to troubleshoot in order: network connection, TLS, authentication, then routing. The steps use iPhone / iPad as an example. No servers or subscriptions are provided.
How Trojan connects: TLS first, then authentication and traffic forwarding
Trojan uses TLS to protect communication between the client and server. To connect, the client first locates the server and connects to the specified port, then performs a TLS handshake and verifies the certificate. Only after the TLS channel is established does it send Trojan authentication data and the destination request. So an open server port does not mean the password is correct, and an enabled connection does not mean a website request has gone through that server.
Think of the settings as three groups: Address and Port determine where to connect; SNI and certificate verification determine whether the TLS peer matches expectations; Password determines whether Trojan authentication succeeds. Each group has a distinct role. Disabling certificate verification will not fix a wrong password, and changing the password will not fix an address lookup failure.
Bottom line: change settings based on the stage where the connection fails
If the error occurs during certificate verification, first check SNI, the certificate name, and the device time. If TLS is established but authentication fails, check Password. Change one setting at a time so you can tell which one affected the result.
How to enter Address, Port, and Password in Add Server
Get the complete settings from your provider first, and confirm that the protocol is explicitly listed as Trojan. Do not use your provider account password, a token from a subscription link, or authentication details for another protocol as the Trojan Password. If you imported a server from a subscription, check each field in the imported entry first. Creating a new configuration manually will not fill in information the provider has not supplied.
| Field | What to enter | Common mistake |
|---|---|---|
| Type | Select Trojan. | Selecting a different protocol while reusing the same address and password. |
| Address | The server domain name or IP address provided by your service provider. | Including https://, a webpage path, spaces, or the port in the address. |
| Port | Enter only the numeric port the server is listening on. | Changing it to 443 just because TLS is involved, instead of using the port provided by your service provider. |
| Password | The Trojan password provided by your service provider. Preserve capitalization and symbols. | Including a line break or quotation marks when copying, or using your account login password. |
| SNI | The TLS server name specified by your service provider, usually a domain name. | Entering a full URL or port, or substituting an arbitrary popular website domain. |
| Allow Insecure | Leave this off during normal use to verify the certificate. | Treating it as a universal switch that must be enabled whenever a connection fails. |
The example below shows only the form of the fields: example.com is a documentation-only domain, and the values shown are not a usable server. Replace the entire set with your own settings rather than changing only Password. Password length and character requirements depend on the server; there is no single format that applies to every Trojan service.
Type: Trojan
Address: example.com
Port: 443
Password: example-only-not-a-real-password
SNI: example.com
Allow Insecure: Off
Add a Trojan server manually: from Home to the first connection test
These steps cover entering a single server manually. If your provider gave you a subscription link, import it through Subscribe instead of pasting the entire link into Address. TLS-related fields may be grouped in a separate settings section. Check each field by its name rather than relying on its position in the list.
-
Create a configuration
Open Home → tap “+” in the upper-right corner to open Add Server, then select Trojan under Type. Confirm the type before entering the settings so switching protocols does not change what the fields mean.
-
Enter connection details
Enter Address, Port, and Password separately. After pasting, check for spaces at either end of Address, make sure Port contains only digits, and verify the capitalization and special characters in Password.
-
Check TLS settings
Check SNI in the TLS settings and leave Allow Insecure off. If your provider specifies additional transport settings, enter them as provided. Do not add a WebSocket path or change the transport on your own.
-
Save and select the server
After saving, return to Home and select the server you just added. If several entries have similar names, check the selected entry’s Address and Port before connecting. The first time you connect, follow the system prompt to allow adding a VPN configuration.
-
Test access
To isolate the effect of regular routing rules, temporarily set Global Routing to Proxy and test a destination you are authorized to access. Restore your original setting afterward. If you normally use Config, check the active configuration and its rules under Config.
SNI and Allow Insecure: a correct name does not mean verification is skipped
SNI tells the server which name is being requested during the TLS handshake. A single IP address may host multiple TLS services, and the server can use SNI to choose a certificate or service. Using an IP for Address and a domain for SNI can be valid, but only if your provider explicitly specifies that setup and the certificate verifies for that name.
Even if Address is a domain, do not assume SNI must be blank or must match Address. If SNI is not set explicitly, the client may derive the server name from the connection address; check whether that matches the requirements for your service. The certificate’s permitted names, server configuration, and SNI actually sent must all match. Entering a different domain at random will not fix a certificate problem.
Allow Insecure off
RecommendedVerifies the certificate. An expired certificate, an untrusted certificate chain, or a name mismatch may cause the connection to be rejected. Check SNI and the device time, and ask your provider to fix the certificate configuration.
Best for: everyday connections and verifying that the server certificate is configured correctly
Allow Insecure on
Relaxing certificate verification weakens server identity checks. Even if the connection succeeds, that does not prove the certificate is configured correctly. This setting cannot fix an unreachable port, a wrong password, or a routing rule that does not match.
Best for: briefly diagnosing a certificate verification issue in a controlled environment; not for routine fixes
If the connection fails with Allow Insecure off but succeeds with it on, that only suggests the issue may be with certificate verification. Turn it off again, note the exact error, and ask your provider to check the certificate validity period, complete certificate chain, and server name. Do not treat “the connection was established” and “the peer’s identity was verified” as the same thing.
Troubleshooting connection failures: check each layer from port to routing rules
Distinguish between “the server cannot be reached” and “the request is not using this server.” Under Global Routing, Direct bypasses the selected proxy; Proxy can temporarily isolate the effect of regular rules; Config routes traffic according to the active configuration; and Scene requires checking its corresponding settings. Seeing a Trojan server selected on Home does not mean every app request will go through it.
It keeps timing out. Does that mean the Password is wrong?
Not necessarily. First, open the server’s edit screen from Home and check Address and Port. Confirm that the domain resolves and that the current network can reach the port. A timeout can also occur during TLS. Password becomes the priority only after the connection is established and authentication begins. Do not change the port, SNI, and password all at once.
I’m getting a certificate error. Should I clear SNI?
Keep the error details, compare SNI with the value from your provider, and check that the device date and time are correct. Clearing SNI may change which certificate the server returns; it does not necessarily fix the problem. An expired certificate or incomplete certificate chain must be fixed on the server, not by leaving Allow Insecure on indefinitely.
It works with Proxy, but not with Config?
That usually points to a routing issue. Open Config and check which file is active, whether the destination domain matches a rule such as DOMAIN-SUFFIX, where the policy sends it, and what FINAL routes to. Switch back to Config and test the same destination. Do not change Trojan settings that you have already confirmed work.
My manually changed SNI reverted after the subscription updated. Why?
A subscription entry may reapply remote settings when it updates. First confirm whether you are editing a subscription entry or a standalone manual entry, then compare the fields before and after the update. If the subscription keeps supplying an incorrect SNI, report it to your provider. Avoid switching back and forth between entries with the same name while testing.
A latency test response only shows that the specific test method received a response; it does not replace a full test of app access. When reporting an error, include the current network, Global Routing mode, test destination, failure stage, and whether it happens only on a particular network. Redact Password, subscription links, and any tokens they contain before sharing logs or screenshots. For help investigating DNS, routing rules, or connection issues, see Troubleshooting.
- Failure before the port connects: Check Address, domain resolution, and Port first. Do not start by changing Password.
- TLS verification failure: Check SNI, the certificate name and validity period, and the device time.
- Authentication failure: Check Type and Password, and make sure the copied value was not additionally encoded or truncated.
- Only some destinations fail: Check Config rule order, policy routing, and whether the destination itself is reachable.