mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-22 02:00:03 +02:00
Backport #20967 Currently, it's impossible to connect to self-signed TLS encrypted redis instances. The problem lies in inproper error handling, when building redis tls options - only invalid booleans are allowed to be used in `tlsConfig` builder. The problem is, when `strconv.ParseBool(...)` returns error, it always defaults to false - meaning it's impossible to set `tlsOptions.InsecureSkipVerify` to true. Fixes #19213 Co-authored-by: Igor Rzegocki <ajgon@users.noreply.github.com>
This commit is contained in:
parent
3aba72c613
commit
71aa64ae25
2 changed files with 20 additions and 2 deletions
|
@ -245,7 +245,7 @@ func getRedisTLSOptions(uri *url.URL) *tls.Config {
|
|||
|
||||
if len(skipverify) > 0 {
|
||||
skipverify, err := strconv.ParseBool(skipverify)
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
tlsConfig.InsecureSkipVerify = skipverify
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ func getRedisTLSOptions(uri *url.URL) *tls.Config {
|
|||
|
||||
if len(insecureskipverify) > 0 {
|
||||
insecureskipverify, err := strconv.ParseBool(insecureskipverify)
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
tlsConfig.InsecureSkipVerify = insecureskipverify
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue