This guide is for users who already have the parameters for a single Trojan server and need to enter them manually in Shadowrocket. Using the iPhone / iPad interface, it explains how to distinguish the connection address from the name used for the TLS handshake, keep certificate verification enabled, and tell whether a problem is caused by the connection, authentication, or routing rules after saving.
Trojan and TLS: What the Address, Certificate, and Password Do
With a typical Trojan over TLS configuration, Shadowrocket first connects to the specified server address and port, then starts a TLS handshake. When certificate verification is enabled, the client checks that the certificate is trusted, within its validity period, and matches the expected server name. Only after the TLS handshake completes does the client send Trojan authentication details and proxy requests over the encrypted connection.
The certificate and password serve different purposes: the certificate confirms that the client has reached the expected server, while the Trojan password lets the server verify the client's credentials. Even with the correct password, a certificate name mismatch will interrupt the connection before authentication. Conversely, a successful TLS handshake does not mean the password is correct.
Check parameters based on where the connection fails
If you see a certificate name error, first check the SNI against the names covered by the server certificate. Don't re-enter the Password. If logs confirm that the TLS handshake completed, check the Password and whether the server accepts those credentials.
Add Server fields: Address, Port, Password, and SNI
Before entering anything, confirm that you have the parameters for a single server, not a subscription URL. The examples below use the documentation-only address 192.0.2.10, the reserved domain edge.example.com, and a fictional password to show the field formats. These values cannot connect to a server; don't copy them to test.
| Field | Example value | How to fill it in |
|---|---|---|
| Type | Trojan | Choose the protocol specified in your configuration; you can't determine the protocol from the port. |
| Address | 192.0.2.10 | Enter a hostname or IP address without https://, a path, or a port. |
| Port | 443 | Enter only the port number. If your configuration specifies 8443, enter 8443; don't replace it with the example port 443. |
| Password | demo-password-not-valid | Enter the server credentials exactly as provided, preserving capitalization and special characters. Remove only quotation marks, spaces, or line breaks accidentally included when copying. |
| SNI | edge.example.com | Enter the TLS server name specified in your configuration. Use the domain name only, without a scheme, port, or path. |
| Allow Insecure | Off | Keep certificate verification enabled. If you encounter a certificate error, check the name and certificate chain instead of enabling this option. |
Address specifies where the connection goes. SNI is the name the client presents to the server during the TLS handshake; it can help a service choose the right certificate when multiple services share an address. The two values don't have to match. For example, a configuration may require connecting to an IP address while using a domain name for the handshake. If your configuration provides a separate SNI, enter it as given. If the address is a domain and no separate SNI is listed, don't guess another name. If the address is an IP and the certificate covers only a domain, ask whoever provided the configuration which name to use.
Manually Add a Trojan Server in Shadowrocket
Before you start, check the address, port, password, and TLS settings for the same server together. Don't combine the Address from one configuration with the SNI from another. If you have a subscription link, import it using the subscription method instead of pasting the entire link into Address.
Open the Add Server screen
Go to
Home, tap+in the top-right corner, and openAdd Server.Choose the protocol
Under
Add Server → Type, selectTrojan, then enter the corresponding fields.Enter the connection details
Fill in
Address,Port, andPasswordseparately. If the address and port are provided together, for exampleedge.example.com:8443, enter the domain before the colon and the number after it in their respective fields.Check the TLS settings
If your configuration lists an
SNI, enter it exactly as provided and keepAllow Insecureoff. If it also specifies a transport method or other parameters, follow the configuration rather than guessing based on the address or port.Save and connect
Tap
Saveto return toHome, select the entry you just added, then turn on the connection switch. If a system VPN permission prompt appears the first time you connect, confirm that the request is from Shadowrocket, then follow the system instructions to grant permission.
Saving only confirms that the fields were entered; it doesn't mean the remote server is reachable. Turning on the connection switch also doesn't mean every request will use this Trojan server—the actual route depends on Global Routing. To test, keep the network, server, and destination the same, and change one setting at a time. This helps avoid mistaking a network change for a parameter fix.
How to Tell Connection Timeouts, Certificate Errors, and Web Page Failures Apart
Start by noting the exact error shown in the app instead of relying only on whether a web page keeps loading. A connection timeout doesn't necessarily mean the password is wrong; if the request hasn't reached the authentication stage, re-entering the password won't help. When reporting an issue to whoever provided the configuration, include the error type, time, and network type in use. Don't share your password, full subscription link, or screenshots containing credentials.
It keeps timing out. Is the port wrong?
Possibly, but a timeout can also be caused by failed name resolution, an unreachable network, or an unresponsive server. Go to Home, open the entry you added, and compare Address and Port character by character. Make sure the port wasn't pasted into the address field. If the parameters match, retry the same configuration on another available network. Don't change the port and SNI at the same time.
The certificate name doesn't match. Should I turn on Allow Insecure?
Keep it off. First check that SNI doesn't include https://, a port, or trailing spaces. Then ask whoever provided the configuration to confirm that the server certificate covers that name. If the error says the certificate has expired or isn't trusted, also check your device's date and time, and ask them to verify the certificate's validity period and chain.
There are no certificate errors. Why can't I connect?
No certificate error doesn't mean the handshake completed. If logs or server records confirm that the handshake succeeded but authentication was rejected, copy Password again from the original configuration. Check for missing special characters or a password copied from a different entry. If it still fails, ask whoever provided the configuration to confirm that the credentials are valid and check the transport settings.
The connection switch is on. Why isn't the web page using this server?
Go to Home → Global Routing. Direct connects directly; Config applies the current configuration's rules, so a DIRECT match also connects directly; Scene depends on the scene settings. To distinguish a server problem from a rules problem, briefly switch to Proxy, test the same web page, then restore the original mode. If it works under Proxy but not as expected under Config, check which rule matches the domain in Config and the order of the rules.