fix(proxy): log error when upstream TLS config creation fails
Previously the error was silently swallowed, causing the proxy to fall back to default TLS settings (no custom CA, no mTLS, no SNI) without any indication. Now the error is logged at ERROR level.
This commit is contained in:
parent
2c3cc1ba38
commit
f6c1ee8180
@ -337,7 +337,9 @@ func createHostClient(targetURL string, timeout config.ProxyTimeout, transportCf
|
||||
// 上游 SSL 配置(使用原生 TLSConfig)
|
||||
if sslCfg != nil && sslCfg.Enabled && isTLS {
|
||||
tlsCfg, err := CreateTLSConfig(sslCfg, extractHostFromURL(targetURL))
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
logging.Error().Err(err).Str("target", targetURL).Msg("Failed to create upstream TLS config")
|
||||
} else {
|
||||
client.TLSConfig = tlsCfg
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user