mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
Fix server crash when no system certificates are found (#6055)
This commit is contained in:
parent
186000328e
commit
670b538dde
@ -86,10 +86,11 @@ func getRootCAs(certsCAsDir string) (*x509.CertPool, error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
rootCAs, err := x509.SystemCertPool()
|
rootCAs, _ := x509.SystemCertPool()
|
||||||
if err != nil {
|
if rootCAs == nil {
|
||||||
// In some systems like Windows, system cert pool is not supported.
|
// In some systems (like Windows) system cert pool is
|
||||||
// Hence we create a new cert pool.
|
// not supported or no certificates are present on the
|
||||||
|
// system - so we create a new cert pool.
|
||||||
rootCAs = x509.NewCertPool()
|
rootCAs = x509.NewCertPool()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user