Description
There are a few areas of improvement for the unit tests for parsing nginx configs with ssl directives and cert files that could be improved:
-
Should test other ssl directives than just
ssl_certificate
since there are several that are supposed to add aux files. -
Should provide a way to ensure the various cert metadata are being determined properly
-
Currently, the tests use the same exact code as the production code to parse the
Validity.NotBefore
,Validity.NotAfter
,SerialNumber
,Fingerprint
,SubjectKeyIdentifier
,AuthorityKeyIdentifier
, which means the values are not being compared against expected knowns - they are being compared to themselves -
See here where these properties are simply being applied to the expected data before asserting equality:
-
-
Consider testing other supported algorithms than just RSA - like DSA, ECDSA, EdDSA and/or ECIES