forge icon indicating copy to clipboard operation
forge copied to clipboard

Clarify the Certificate is not trusted Error.

Open dopry opened this issue 10 years ago • 0 comments

I was working with the library and ran into the 'Certificate is not trusted Error'.There was a CN mismatch, but not being familiar with the library I was unsure what this error message meant or why the certificate was not trusted. After some debugging I discovered it was a subject mismatch and a matching certificate was not found in the caStore.

This PR modified the error message to identify the possible issues to a consumer.

I'm not very satisfied with the error message. It represents two possible error cases and is much longer than the other error conditions. It would be nice to separate DER validation from the caStore.hasCertificate method, so this error messaged could be more concise.

I cannot pursue refactoring hasCertificate at the moment, so I am proposing just updating the error message for now. If the changes would be welcome open an issue and assign it to me. I'll try to get around to it when time allows.

dopry avatar Aug 09 '15 17:08 dopry