Skip to content

Commit 8738667

Browse files
authored
Ignore https bad cert error for chartrepo (#50)
* Ignore https bad cert error for chartrepo
1 parent 1793bd9 commit 8738667

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

controllers/chartrepo_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package controllers
1818
import (
1919
"bytes"
2020
"context"
21+
"crypto/tls"
2122
"fmt"
2223
"github.com/alauda/captain/pkg/util"
2324
"github.com/go-logr/logr"
@@ -132,7 +133,10 @@ func (r *ChartRepoReconciler) GetIndex(cr *alaudaiov1alpha1.ChartRepo, ctx conte
132133
}
133134

134135
link := strings.TrimSuffix(cr.Spec.URL, "/") + "/index.yaml"
135-
c := &http.Client{Timeout: 30 * time.Second}
136+
transCfg := &http.Transport{
137+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // ignore expired SSL certificates
138+
}
139+
c := &http.Client{Timeout: 30 * time.Second, Transport: transCfg}
136140
req, err := http.NewRequest("GET", link, nil)
137141

138142
if username != "" && password != "" {

0 commit comments

Comments
 (0)