{"record":{"id":"cdaab0641865a4ab","repo":"t8y2/dbx","slug":"invalid-host-verification-option-w","errorCode":null,"errorMessage":"invalid host verification option: %w","messagePattern":"invalid host verification option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":224,"sourceCode":"\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)\n\t\t\t}\n\t\t\tconfig.keepAlive = enabled\n\t\tcase \"user\":\n\t\t\tconfig.username = value\n\t\tcase \"password\":\n\t\t\tconfig.password = value","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L206-L242","documentation":"The host-verification URL parameters ('hostverification', 'verifyhostname', 'sslhostnameverification', 'hostnameverification') must parse as booleans via strconv.ParseBool. Any other string yields this error, preventing ambiguous TLS hostname-verification settings.","triggerScenarios":"hostverification=yes, verifyhostname=on, hostnameverification=TRUE ITALIC copy-paste variants, or values with trailing whitespace in a cassandra:// URL.","commonSituations":"Reusing 'yes/no' toggles from other DB connection strings, secrets templating inserting quoted strings ('\"true\"'), or users disabling verification with values the parser doesn't accept.","solutions":["Use hostverification=true or false (strconv.ParseBool-compatible values: 1/t/T/TRUE/true/True, 0/f/F/FALSE/false/False).","Strip quotes and whitespace from templated values before URL assembly.","Note that setting this to false weakens TLS security; prefer true with proper certificates.","Check the full error's %w cause to confirm it is a ParseBool syntax error."],"exampleFix":"// before\ncassandra://host:9042?ssl=true&verifyhostname=on\n// after\ncassandra://host:9042?ssl=true&verifyhostname=true","handlingStrategy":"validation","validationCode":"v := strings.TrimSpace(strings.Trim(verifyHost, \"\\\"\"))\nif _, err := strconv.ParseBool(v); err != nil {\n\treturn fmt.Errorf(\"verifyhostname must be true/false, got %q\", verifyHost)\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 host verification option\") {\n\t\treturn fmt.Errorf(\"hostverification aliases accept only strconv.ParseBool values: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Strip quotes and whitespace that templating engines add around values","Keep host verification enabled (true) and fix certificates instead of disabling","Test generated DSNs with url.ParseQuery in CI"],"tags":["cassandra","config","ssl","tls","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-14T00:17:10.932Z"}