{"record":{"id":"b0695fbf396593dc","repo":"shadowsocks/shadowsocks-windows","slug":"password-can-not-be-blank","errorCode":null,"errorMessage":"Password can not be blank","messagePattern":"Password can not be blank","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"shadowsocks-csharp/Model/Configuration.cs","lineNumber":368,"sourceCode":"        }\r\n\r\n        public static void CheckPort(int port)\r\n        {\r\n            if (port <= 0 || port > 65535)\r\n                throw new ArgumentException(I18N.GetString(\"Port out of range\"));\r\n        }\r\n\r\n        public static void CheckLocalPort(int port)\r\n        {\r\n            CheckPort(port);\r\n            if (port == 8123)\r\n                throw new ArgumentException(I18N.GetString(\"Port can't be 8123\"));\r\n        }\r\n\r\n        private static void CheckPassword(string password)\r\n        {\r\n            if (string.IsNullOrEmpty(password))\r\n                throw new ArgumentException(I18N.GetString(\"Password can not be blank\"));\r\n        }\r\n\r\n        public static void CheckServer(string server)\r\n        {\r\n            if (string.IsNullOrEmpty(server))\r\n                throw new ArgumentException(I18N.GetString(\"Server IP can not be blank\"));\r\n        }\r\n\r\n        public static void CheckTimeout(int timeout, int maxTimeout)\r\n        {\r\n            if (timeout <= 0 || timeout > maxTimeout)\r\n                throw new ArgumentException(\r\n                    I18N.GetString(\"Timeout is invalid, it should not exceed {0}\", maxTimeout));\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":350,"sourceCodeEnd":385,"githubUrl":"https://github.com/shadowsocks/shadowsocks-windows/blob/891d971682eefcaa2e640258d3b352a3ad3b2233/shadowsocks-csharp/Model/Configuration.cs#L350-L385","documentation":"ArgumentException thrown by CheckPassword when the password is null or empty. Shadowsocks derives the session key from the password, so a blank password yields a zero/weak key and is rejected during server validation.","triggerScenarios":"A server config saved with an empty password field. The password was cleared in the GUI. An imported SS URL or QR code is missing the password segment.","commonSituations":"An ss:// URL missing the password. A new server entry saved before the password was typed. Config edited externally and the password deleted.","solutions":["Enter a non-empty password for the server.","Re-scan the SS QR code or re-paste the full ss:// URL including the password.","Edit gui-config.json to set a non-empty password and reload."],"exampleFix":"// before\nConfiguration.CheckPassword(\"\");\n\n// after\nConfiguration.CheckPassword(\"your-strong-password\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(password)) {\n    // block Save / report error before calling CheckPassword\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { Configuration.CheckPassword(pw); }\ncatch (ArgumentException ex) { /* prompt the user for a password */ }","preventionTips":["Require a non-empty password before enabling the Save button.","Validate imported SS URLs and reject those missing the password segment."],"tags":["configuration","validation","password","security"],"backgroundTag":null,"analyzedSha":"891d971682eefcaa2e640258d3b352a3ad3b2233","analyzedAt":"2026-08-13T10:12:34.434Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}