openssl: Generated X.509 certs should be RFC 5280 compliant by default

Meanwhile we have stronger checks for X.509 certificates to comply to RFC 5280, at least when strict checking is enabled (e.g., using -x509_strict).

Yet unfortunately the OpenSSL apps by default tend to generate certs that are not compliant. In particular, X.509v3 certs (i.e., those having any X.509 extensions) MUST include

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

This brings me to a refinement of my plan:

Make the following X.509 extension configuration options the default:

subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid

and provide for both of them the possibility to provide instead the value no for disabling (default) generation, i.e.,

subjectKeyIdentifier=no
authorityKeyIdentifier=no

Regarding non-CA certs, the subject key identifier (SKID) is still listed as a SHOULD in RFC 5280:

For end entity certificates, the subject key identifier extension provides a means for identifying certificates containing the particular public key used in an application. Where an end entity has obtained multiple certificates, especially from multiple CAs, the subject key identifier provides a means to quickly identify the set of certificates containing a particular public key. To assist applications in identifying the appropriate end entity certificate, this extension SHOULD be included in all end entity certificates.

So, while not mandatory, we might want OpenSSL apps generating end-entity certs to include a SKID by default (along with an AKID if they are not self-signed).

I like your refinement; thanks @ddvo.

Your plan makes sense. But I think you should add a config option to make it not happen. A common use of openssl is to generate test certs.

This is something that would be nice to get fixed for 3.0 however it is IMO not a blocker for 3.0 either.