{"record":{"id":"f65d6d35a33553a0","repo":"XTLS/Xray-core","slug":"trojan-without-tls-is-prohibited-unless-the-server","errorCode":null,"errorMessage":"trojan without TLS is prohibited unless the server address is a private IP or domain","messagePattern":"trojan without TLS is prohibited unless the server address is a private IP or domain","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/xray.go","lineNumber":261,"sourceCode":"}\n\nfunc validateOutboundTransportSecurity(rawConfig interface{}, senderSettings *proxyman.SenderConfig) error {\n\tif senderSettings.StreamSettings != nil && senderSettings.StreamSettings.GetSecurityType() != \"\" {\n\t\treturn nil\n\t}\n\n\tif vlessCfg, ok := rawConfig.(*VLessOutboundConfig); ok {\n\t\tif vlessCfg.Encryption != \"\" && vlessCfg.Encryption != \"none\" {\n\t\t\treturn nil\n\t\t}\n\t\tif requiresTransportSecurity(vlessCfg.Address) {\n\t\t\treturn errors.New(\"vless without TLS or other encryption is prohibited unless the server address is a private IP or domain\")\n\t\t}\n\t}\n\n\tif tjCfg, ok := rawConfig.(*TrojanClientConfig); ok {\n\t\tif requiresTransportSecurity(tjCfg.Address) {\n\t\t\treturn errors.New(\"trojan without TLS is prohibited unless the server address is a private IP or domain\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Build implements Buildable.\nfunc (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) {\n\tsenderSettings := &proxyman.SenderConfig{}\n\tswitch strings.ToLower(c.TargetStrategy) {\n\tcase \"asis\", \"\":\n\t\tsenderSettings.TargetStrategy = internet.DomainStrategy_AS_IS\n\tcase \"useip\":\n\t\tsenderSettings.TargetStrategy = internet.DomainStrategy_USE_IP\n\tcase \"useipv4\":\n\t\tsenderSettings.TargetStrategy = internet.DomainStrategy_USE_IP4\n\tcase \"useipv6\":\n\t\tsenderSettings.TargetStrategy = internet.DomainStrategy_USE_IP6","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/xray.go#L243-L279","documentation":"Error \"trojan without TLS is prohibited unless the server address is a private IP or domain\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at infra/conf/xray.go:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}