// UnknownAuthorityError results when the certificate issuer is unknown
type UnknownAuthorityError struct {
- cert *Certificate
+ Cert *Certificate
// hintErr contains an error that may be helpful in determining why an
// authority wasn't found.
hintErr error
}
func expectAuthorityUnknown(t *testing.T, i int, err error) (ok bool) {
- if _, ok := err.(UnknownAuthorityError); !ok {
+ e, ok := err.(UnknownAuthorityError)
+ if !ok {
t.Errorf("#%d: error was not UnknownAuthorityError: %s", i, err)
return false
}
+ if e.Cert == nil {
+ t.Errorf("#%d: error was UnknownAuthorityError, but missing Cert: %s", i, err)
+ return false
+ }
return true
}
t.Errorf("#%d: Unable to parse certificate -> %s", i, err)
}
uae := &UnknownAuthorityError{
- cert: c,
+ Cert: c,
hintErr: fmt.Errorf("empty"),
hintCert: c,
}