This guide is for users with an existing service configuration who need to add Trojan manually in Shadowrocket. Check Address, Port, Password, SNI, and certificate verification in order to distinguish address errors, TLS handshake issues, authentication failures, and routing problems. The domain names and ports shown here are examples for explaining fields, not working services. This site does not provide, sell, or recommend proxy servers or subscriptions.
What you need for a Trojan connection
Trojan typically establishes a TLS connection first, then authenticates and carries proxy requests inside the encrypted connection. Like regular HTTPS, it uses TLS, but its purpose and application-layer content are different. A domain name or password alone is not a complete configuration: the server must be running the matching service, and the client’s address, port, password, and TLS settings must match it.
Before you begin, check the following details in the configuration you already have. If you have a complete import link or subscription, keep its original parameters; manual entry is useful for checking fields, not for guessing server settings from experience. These steps use Home → “+” → Add Server on iPhone / iPad as an example. Field locations on other platforms may differ; follow the interface shown on your device.
| Item | Where to enter it | What to confirm |
|---|---|---|
| Protocol type | Type | Select Trojan. Do not use credentials for another protocol here. |
| Server address | Address | Enter a hostname or IP address without a URL scheme, path, or port. |
| Server port | Port | Use the integer port provided in the configuration. Do not change it to 443 just because TLS is used. |
| Authentication password | Password | Preserve every character exactly, including capitalization and symbols, and check for accidental spaces. |
| TLS server name | SNI | Use the TLS name specified by the service and check that it is covered by the certificate. |
| Additional transport parameters | Corresponding transport settings | If the original configuration includes WebSocket, Host, or Path, keep those settings too. Do not omit them as you might for a standard TCP configuration. |
Enter the details in Add Server
Keep a copy of the original details before you start. Do not overwrite a record that still works; creating a separate entry makes comparison easier and lets you trace changes if something goes wrong. The steps below cover standard Trojan over TLS. If your configuration specifies another transport, fill in its required fields as instructed.
-
Select the type
Go to Home, tap “+” in the upper-right corner to open Add Server, then select Trojan under Type. Make sure the screen shows Trojan settings; changing only the record name to Trojan is not enough.
-
Enter the address
Enter the server hostname or IP under Address, and the port separately under Port. For example, if the details show
edge.example.com:443, enteredge.example.comas Address and443as Port. This domain is only an example. -
Enter the password
Paste the authentication value from your service configuration into Password. Do not use your website login password or a token from a subscription link. If you see a line break or spaces at either end, compare with the original before making changes. Do not remove symbols within the password.
-
Check TLS
Check TLS and SNI against the original configuration, and leave Allow Insecure turned off. SNI should be a hostname only, without
https://, a slash, or a port. If Address is an IP, take particular care to confirm the server’s specified name. -
Save and test
After saving, return to Home, select the entry, check the current Global Routing mode, and start the connection. When prompted by the system to add a VPN configuration for the first time, follow the prompt. Then test with an actual request; a single latency result does not prove that everything is working.
If the same entry is available through a subscription, compare its imported settings with the manually entered record field by field. Subscription updates may regenerate or overwrite entries. Keep troubleshooting changes that need to persist in a separate record, and remember that subscription links and screenshots may contain access credentials.
Common mistakes with Password, Address, and Port
Password is used to authenticate with the Trojan service. It has nothing to do with your phone passcode or app purchase credentials. A successful TLS handshake does not mean the password is correct: certificate verification happens before authentication, and a wrong password can still cause the connection to close shortly after it is established. So a closed connection does not necessarily indicate an SNI error.
- Address is not a complete URL. Do not enter the entire
https://edge.example.com/pathas the server address. Enter any required transport Path in its own field, rather than appending it to Address. - The protocol name does not determine the port. If your configuration specifies
8443, keep that value. Changing it to443may connect to a different service. Even if that service presents a valid certificate, it does not mean your configuration is correct. - Do not calculate a password digest manually. The client handles the authentication encoding required by the protocol. Do not convert, truncate, or re-encode the password unless the original configuration explicitly gives that string as the password itself.
- An import link is not the same as the original field value. Special characters in a link may be percent-encoded. Do not paste the entire link into Password or repeatedly decode it without understanding where the encoded value begins and ends.
Bottom line: correct the input before changing connection options
Leave the other options unchanged until you have checked Address, Port, and Password. Change one item at a time and repeat the same request to identify what affected the result.
How SNI, TLS, and certificate names fit together
SNI is the server name sent during the TLS handshake. Servers sharing an IP can use it to select a certificate and service configuration. Certificate verification checks whether the peer’s certificate is trusted, within its validity period, and matches the expected name. SNI is not the server IP, nor is it the HTTP Host in a web request.
For example, an existing configuration might specify Address as 192.0.2.10 and SNI as tls.example.com. These can differ as expected: the former determines the connection target, while the latter is used for TLS name-related processing. 192.0.2.10 is a documentation example address and cannot be used for an actual connection. Do not use it as a reason to replace the SNI in a real configuration with an arbitrary website domain.
| Configuration | What to check | Avoid |
|---|---|---|
| Address is a domain; no separate SNI is listed | Keep the imported value or default behavior. If a name-related error occurs, ask the configuration provider which TLS name is expected. | Do not enter a random domain just to fill in the field. |
| Address is an IP; a separate SNI is listed | Keep the IP as the connection target, use the specified hostname for SNI, and confirm that it matches the certificate. | Do not swap the IP and SNI. |
| Certificate reported as expired or untrusted | Check the device time, certificate validity period, and certificate chain. The server operator should correct the certificate deployment. | Do not leave verification disabled to hide deployment problems. |
| Original configuration includes WebSocket | Check SNI, Host, and Path separately. Their values may be the same or different. | Do not assume that setting SNI replaces the other transport parameters. |
Standard Trojan relies on TLS. Do not treat disabling TLS as a routine troubleshooting step, or assume TLS is available just because the port is 443. The server’s listening mode, certificate, and client settings must match. If the transport does not match, changing the password usually will not help.
How to set Allow Insecure
Allow Insecure controls whether verification of the server’s TLS certificate is relaxed. It is not a general-purpose switch for “improving compatibility” or “increasing speed.” If verification is relaxed, traffic may still be encrypted, but that does not confirm that the other end of the encrypted connection is the intended server. This weakens protection against server impersonation.
Allow Insecure off
RecommendedKeep certificate verification enabled. Treat a name mismatch, expired certificate, or problem with the trust chain as something to fix, not bypass.
Use for: everyday connections and configurations with valid, trusted certificates.
Allow Insecure on
Relaxes certificate verification; it cannot fix an incorrect Address, Port, or Password. Even if the connection works again, that only suggests a possible certificate verification issue—it does not prove the service configuration is correct.
Use for: brief troubleshooting in a controlled test environment. Turn it off again afterward and fix the certificate issue.
Bottom line: address certificate issues at the certificate layer
If the connection works only when Allow Insecure is on, note the error type, turn the option off, and check SNI, device time, and the server’s certificate chain. Do not save this as your everyday configuration.
A self-signed certificate does not automatically mean all verification must be skipped. Controlled environments should have a clear process for distributing and verifying trust. If you are unfamiliar with that process, ask the provider of your existing service configuration rather than copying a generic screenshot from the internet.
Still can’t connect after saving? Troubleshoot by layer
First make sure the request is actually going through the entry you just added. Selecting an entry on Home does not guarantee that the request will use it; Global Routing and Config rules also affect the traffic path. Change only one variable at a time and retest with the same destination request so you do not confuse network changes, rule changes, and password changes.
- Check the connection target first. For repeated timeouts, check address resolution, whether the destination port is reachable, and current network restrictions. If the connection is refused, check the port listener first. A single symptom is not enough to conclude that the password is wrong.
- Then check TLS. If the error specifically mentions a certificate or handshake, check SNI, device time, the certificate chain, and the transport type. A failed handshake can have several causes; use the specific error rather than relying on the word “failed.”
- Next, check authentication. If the TLS stage succeeds but the request disconnects immediately, recheck Password, account status, and the server’s requirements. A valid certificate does not mean you can skip checking the password.
- Rule out routing issues. In Home → Global Routing, you can briefly use the Proxy mode to test the proxy path for the selected entry. Direct does not test whether Trojan works; Config applies the policy set by the current configuration rules. Also check the active settings for Scene—it is not a fixed global proxy mode.
- Restore your usual configuration. If requests work in Proxy but fail in Config, return to Config and check the rules and their policy targets. Check
DOMAIN-SUFFIX,IP-CIDR,GEOIP, and the finalFINALrule in order. Make sure an earlier rule is not matching the destination request first.
Latency tests usually cover only part of the connection process and cannot replace an actual web or app request. Also distinguish between “the tunnel did not start” and “the tunnel started but requests fail”: for the former, first check the system VPN configuration status; for the latter, check proxy settings and rules. If the connection starts again after you manually disconnect, check whether Settings → On Demand is enabled and review its trigger conditions. It controls on-demand connections; it does not fix a Trojan password or SNI.
For more on rules and fields, see the Settings Reference. If an imported configuration works but a manual one does not, compare the transport and TLS settings of both entries field by field. If neither works, check the network and the status of your existing service. Do not keep trying combinations of unverified settings.