Skip insecure certificates check when scraping (#1120)

* Ignore insecure certificates when scraping
* add ScraperCertCheck to scraper config options
This commit is contained in:
bnkai
2021-03-01 02:47:39 +02:00
committed by GitHub
parent a9ac176e91
commit 144cd6e4f2
9 changed files with 47 additions and 0 deletions

View File

@@ -1,11 +1,13 @@
package scraper
import (
"crypto/tls"
"io/ioutil"
"net/http"
"strings"
"time"
stashConfig "github.com/stashapp/stash/pkg/manager/config"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/utils"
)
@@ -83,6 +85,8 @@ func setMovieBackImage(m *models.ScrapedMovie, globalConfig GlobalConfig) error
func getImage(url string, globalConfig GlobalConfig) (*string, error) {
client := &http.Client{
Transport: &http.Transport{ // ignore insecure certificates
TLSClientConfig: &tls.Config{InsecureSkipVerify: !stashConfig.GetScraperCertCheck()}},
Timeout: imageGetTimeout,
}