Skip to content

Commit

Permalink
fix: solve quality issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michael12312 committed Sep 26, 2023
1 parent 7f06f3e commit b019213
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/plugins/identity/oidc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ func addItem(configSet config.ConfigurationSet, key string, value string) {
func SetTransport(file string) {

var config *tls.Config
skipReadCert := false
if file == "" {
skipReadCert = true
}

if file != "" {
caCert, err := os.ReadFile(file)
if err != nil {
Expand All @@ -242,7 +247,7 @@ func SetTransport(file string) {
RootCAs: caCertPool,
}
} else {
config = &tls.Config{InsecureSkipVerify: true}
config = &tls.Config{InsecureSkipVerify: skipReadCert}
}
http.DefaultTransport.(*http.Transport).TLSClientConfig = config
}
Expand Down

0 comments on commit b019213

Please sign in to comment.