{"record":{"id":"8e5e9da3654a4fdd","repo":"t8y2/dbx","slug":"invalid-ssl-option-w","errorCode":null,"errorMessage":"invalid ssl option: %w","messagePattern":"invalid ssl option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":218,"sourceCode":"\t\t\tconfig.serialConsistency = value\n\t\tcase \"numconns\", \"connectionsperhost\":\n\t\t\tcount, err := strconv.Atoi(value)\n\t\t\tif err != nil || count < 1 || count > 32 {\n\t\t\t\treturn fmt.Errorf(\"numconns must be between 1 and 32\")\n\t\t\t}\n\t\t\tconfig.numConnections = count\n\t\tcase \"pagesize\", \"fetchsize\":\n\t\t\tsize, err := strconv.Atoi(value)\n\t\t\tif err != nil || size < 1 {\n\t\t\t\treturn fmt.Errorf(\"pagesize must be positive\")\n\t\t\t}\n\t\t\tconfig.pageSize = size\n\t\tcase \"cqlversion\":\n\t\t\tconfig.cqlVersion = value\n\t\tcase \"ssl\", \"enablessl\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid ssl option: %w\", err)\n\t\t\t}\n\t\t\tconfig.ssl = enabled\n\t\tcase \"hostverification\", \"verifyhostname\", \"sslhostnameverification\", \"hostnameverification\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid host verification option: %w\", err)\n\t\t\t}\n\t\t\tconfig.hostVerification = enabled\n\t\tcase \"tcpnodelay\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid tcpnodelay option: %w\", err)\n\t\t\t}\n\t\t\tconfig.tcpNoDelay = enabled\n\t\tcase \"keepalive\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid keepalive option: %w\", err)","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L200-L236","documentation":"The 'ssl' (alias 'enablessl') URL parameter must be a boolean parseable by strconv.ParseBool (1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False). Any other value produces this wrapped error and aborts DSN parsing.","triggerScenarios":"ssl=yes, enablessl=on, ssl=\"true \" (with whitespace), or ssl=enabled in a cassandra:// URL.","commonSituations":"Using human-friendly booleans ('yes'/'on'/'enabled') from YAML/env config, whitespace from environment variables, or locale-formatted values.","solutions":["Use ssl=true or ssl=1 to enable, ssl=false or ssl=0 to disable.","Trim whitespace/newlines from values sourced from environment variables before building the URL.","Normalize yes/on/enabled to true in whatever generates the connection string.","URL-encode the value if it may contain stray characters."],"exampleFix":"// before\ncassandra://host:9042?ssl=yes\n// after\ncassandra://host:9042?ssl=true","handlingStrategy":"validation","validationCode":"func parseStrictBool(v string) (bool, error) {\n\tb, err := strconv.ParseBool(strings.TrimSpace(v))\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"%q is not a bool; use true/false/1/0\", v)\n\t}\n\treturn b, nil\n}","typeGuard":"func isParseBoolValue(v string) bool {\n\t_, err := strconv.ParseBool(v)\n\treturn err == nil\n}","tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"invalid ssl option\") {\n\t\treturn fmt.Errorf(\"ssl must be true/false (not yes/on): %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Normalize yes/on/enabled to true at config-load time","Trim whitespace from env-sourced values before URL assembly","Use a shared strict-bool helper for all DSN boolean parameters"],"tags":["cassandra","config","ssl","boolean-parse"],"backgroundTag":"invalid-boolean-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}