-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(url): Add skip_verify param #22
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
=======================================
Coverage 94.68% 94.68%
=======================================
Files 92 92
Lines 39096 39106 +10
=======================================
+ Hits 37019 37029 +10
Misses 1763 1763
Partials 314 314 ☔ View full report in Codecov by Sentry. |
url.go
Outdated
if q.Get("skip_verify") == "" { | ||
opt.TLSConfig.InsecureSkipVerify = true | ||
} else { | ||
skipVerify, err := strconv.ParseBool(q.Get("skip_verify")) | ||
if err != nil { | ||
return opt, fmt.Errorf("valkey: invalid skip verify: %q", q.Get("skip_verify")) | ||
} | ||
opt.TLSConfig.InsecureSkipVerify = skipVerify | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if q.Get("skip_verify") == "" { | |
opt.TLSConfig.InsecureSkipVerify = true | |
} else { | |
skipVerify, err := strconv.ParseBool(q.Get("skip_verify")) | |
if err != nil { | |
return opt, fmt.Errorf("valkey: invalid skip verify: %q", q.Get("skip_verify")) | |
} | |
opt.TLSConfig.InsecureSkipVerify = skipVerify | |
} | |
if v := q.Get("skip_verify"); v == "" { | |
opt.TLSConfig.InsecureSkipVerify = true | |
} else { | |
skipVerify, err := strconv.ParseBool(v) | |
if err != nil { | |
return opt, fmt.Errorf("valkey: invalid skip verify: %q", v) | |
} | |
opt.TLSConfig.InsecureSkipVerify = skipVerify | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM mostly, but the indention on line 97 is wrong, and one minor improvement is you can store the result of q.Get() into a variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions applied
Add `skip_verify` or `skip_verify=true` to disable TLS certificate verification. Default is false. Inspired by various Go drivers: - ClickHouse: https://github.com/ClickHouse/clickhouse-go/blob/v2.30.0/clickhouse_options.go#L259 - MongoDB: https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/x/mongo/driver/connstring/connstring.go#L609 - MySQL: https://github.com/go-sql-driver/mysql/blob/v1.8.1/dsn.go#L175 Signed-off-by: Julien Riou <[email protected]>
Add `skip_verify` or `skip_verify=true` to disable TLS certificate verification. Default is false. Inspired by various Go drivers: - ClickHouse: https://github.com/ClickHouse/clickhouse-go/blob/v2.30.0/clickhouse_options.go#L259 - MongoDB: https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/x/mongo/driver/connstring/connstring.go#L609 - MySQL: https://github.com/go-sql-driver/mysql/blob/v1.8.1/dsn.go#L175 Signed-off-by: Julien Riou <[email protected]>
Add
skip_verify
orskip_verify=true
to disable TLS certificate verification. Default is false.Inspired by various Go drivers: