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:
parent
017a6b0a10
commit
f31ee53c27
3 changed files with 63 additions and 32 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue