{"record":{"id":"d0e3b77d9506e311","repo":"shadowsocks/shadowsocks-rust","slug":"unsupported-method","errorCode":null,"errorMessage":"unsupported method","messagePattern":"unsupported method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/config.rs","lineNumber":2152,"sourceCode":"            ConfigType::OnlineConfig => ServerSource::OnlineConfig,\n        };\n\n        // Standard config\n        // Server\n        match (config.server, config.server_port, config.password, &config.method) {\n            (Some(address), Some(port), pwd_opt, Some(m)) => {\n                let addr = match address.parse::<Ipv4Addr>() {\n                    Ok(v4) => ServerAddr::SocketAddr(SocketAddr::V4(SocketAddrV4::new(v4, port))),\n                    Err(..) => match address.parse::<Ipv6Addr>() {\n                        Ok(v6) => ServerAddr::SocketAddr(SocketAddr::V6(SocketAddrV6::new(v6, port, 0, 0))),\n                        Err(..) => ServerAddr::DomainName(address, port),\n                    },\n                };\n\n                let method = match m.parse::<CipherKind>() {\n                    Ok(m) => m,\n                    Err(..) => {\n                        let err = Error::new(\n                            ErrorKind::Invalid,\n                            \"unsupported method\",\n                            Some(format!(\"`{m}` is not a supported method\")),\n                        );\n                        return Err(err);\n                    }\n                };\n\n                // Only \"password\" support getting from environment variable.\n                let password = match pwd_opt {\n                    Some(ref pwd) => read_variable_field_value(pwd),\n                    None => {\n                        if method.is_none() {\n                            String::new().into()\n                        } else {\n                            let err = Error::new(\n                                ErrorKind::MissingField,\n                                \"`password` is required\",","sourceCodeStart":2134,"sourceCodeEnd":2170,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/config.rs#L2134-L2170","documentation":"This is a sentinel validation error from config parsing: the cipher method string supplied for a server entry is not one of the shadowsocks encryption algorithms the crate recognizes. It fires in the standard-config match arm where server address, port, password, and method are all present but the method value fails to map to a known cipher, so no SupportedCipher can be constructed. The input at fault is the `method` field of the server configuration (e.g. a typo or an unsupported/renamed cipher name like 'aes-256-cfb' or 'rc4-md5').","triggerScenarios":"Config parsing where a server object's `method` string is not a supported cipher: misspelled names, legacy ciphers removed in newer versions (e.g. `rc4-md5`, `aes-256-cfb`), or empty strings.","commonSituations":"Migrating from old shadowsocks clients using legacy stream ciphers no longer compiled in; typos like `aes-256-gmc`; provider lists a cipher built without the corresponding feature flag; case/format mismatches.","solutions":["Use a supported method such as `aes-256-gcm`, `chacha20-ietf-poly1305`, or `2022-blake3-aes-256-gcm`","Check the exact spelling of the method string","Upgrade/rebuild the crate with the cipher feature flags you need (e.g. `aes-crypto`, or accept `plain` explicitly)","Ask the provider to migrate away from removed legacy ciphers"],"exampleFix":"// before\n{\"method\": \"aes-256-cfb\"}\n// after\n{\"method\": \"aes-256-gcm\"}","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\"aes-256-gcm\", \"aes-128-gcm\", \"chacha20-ietf-poly1305\", \"2022-blake3-aes-256-gcm\", \"2022-blake3-chacha20-poly1305\"];\n// before load: assert SUPPORTED.contains(&method_str), or parse::<shadowsocks::crypto::CipherKind>() in a pre-check","typeGuard":null,"tryCatchPattern":"match method_str.parse::<shadowsocks::crypto::CipherKind>() {\n    Ok(k) => k,\n    Err(_) => { eprintln!(\"unsupported method {method_str}\"); return; }\n}","preventionTips":["Migrate away from legacy stream ciphers (rc4-md5, cfb)","Copy method strings from official docs, not by hand","Ensure the crate is built with the needed cipher features"],"tags":["cipher","config","sip008"],"backgroundTag":"invalid-enum-value","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}