forked from TrueCloudLab/lego
fix panic for situation common with self-signed certs
This commit is contained in:
parent
3842dc6432
commit
f146acc019
1 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,10 @@ func GetOCSPForCert(bundle []byte) ([]byte, int, error) {
|
||||||
// We only got one certificate, means we have no issuer certificate - get it.
|
// We only got one certificate, means we have no issuer certificate - get it.
|
||||||
if len(certificates) == 1 {
|
if len(certificates) == 1 {
|
||||||
// TODO: build fallback. If this fails, check the remaining array entries.
|
// TODO: build fallback. If this fails, check the remaining array entries.
|
||||||
|
if len(certificates[0].IssuingCertificateURL) == 0 {
|
||||||
|
return nil, OCSPUnknown, errors.New("no issuing certificate URL")
|
||||||
|
}
|
||||||
|
|
||||||
resp, err := http.Get(certificates[0].IssuingCertificateURL[0])
|
resp, err := http.Get(certificates[0].IssuingCertificateURL[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, OCSPUnknown, err
|
return nil, OCSPUnknown, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue