Skip to content

Commit fbbddc2

Browse files
authored
feat(fetcher): remove TLS InsecureSkipVerify (#430)
1 parent a455521 commit fbbddc2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

fetcher/fetcher.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package fetcher
33
import (
44
"bytes"
55
"compress/gzip"
6-
"crypto/tls"
76
"io"
87
"net/http"
98
"net/url"
@@ -48,9 +47,6 @@ func FetchFeedFile(urlstr string, gzip bool) (body []byte, err error) {
4847
func fetchFile(urlstr string, isGzip bool) (body []byte, err error) {
4948
var proxyURL *url.URL
5049
httpClient := &http.Client{
51-
Transport: &http.Transport{
52-
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
53-
},
5450
Timeout: time.Duration(180 * time.Second),
5551
}
5652
if viper.GetString("http-proxy") != "" {
@@ -59,9 +55,9 @@ func fetchFile(urlstr string, isGzip bool) (body []byte, err error) {
5955
}
6056
httpClient = &http.Client{
6157
Transport: &http.Transport{
62-
Proxy: http.ProxyURL(proxyURL),
63-
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
58+
Proxy: http.ProxyURL(proxyURL),
6459
},
60+
Timeout: time.Duration(180 * time.Second),
6561
}
6662
}
6763
req, err := http.NewRequest("GET", urlstr, nil)

0 commit comments

Comments
 (0)