mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Load client certs early to detect misconfiguration
* Move loading of client certificate into the TLS handling code to an earlier position.
This commit is contained in:
parent
be15d43dd3
commit
1241429d19
2 changed files with 19 additions and 6 deletions
|
|
@ -359,12 +359,8 @@ func (p *processor) httpClient() util.Client {
|
|||
tlsConfig.InsecureSkipVerify = true
|
||||
}
|
||||
|
||||
if p.opts.ClientCert != nil && p.opts.ClientKey != nil {
|
||||
cert, err := tls.LoadX509KeyPair(*p.opts.ClientCert, *p.opts.ClientKey)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
tlsConfig.Certificates = []tls.Certificate{cert}
|
||||
if len(p.opts.clientCerts) != 0 {
|
||||
tlsConfig.Certificates = p.opts.clientCerts
|
||||
}
|
||||
|
||||
hClient.Transport = &http.Transport{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue