1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Add client certificate support to the downloader

This commit is contained in:
Sascha L. Teichmann 2023-08-02 21:16:32 +02:00
parent 017a6b0a10
commit f31ee53c27
3 changed files with 63 additions and 32 deletions

View file

@ -84,9 +84,14 @@ func (d *downloader) httpClient() util.Client {
var tlsConfig tls.Config
if d.cfg.Insecure {
tlsConfig.InsecureSkipVerify = true
hClient.Transport = &http.Transport{
TLSClientConfig: &tlsConfig,
}
}
if len(d.cfg.clientCerts) != 0 {
tlsConfig.Certificates = d.cfg.clientCerts
}
hClient.Transport = &http.Transport{
TLSClientConfig: &tlsConfig,
}
client := util.Client(&hClient)