openssl is grim

I've just spent a whole day trying to generate a certificate with openssl that firefox / chromium will accept.

The issue is something like: the convention changed from sticking a domain name in the CN (common name) field, to using subjectAltName.  Browsers stopped accepting the old one.  But the openssl tooling was not updated with a usable tool, instead requiring arcane, undocumented, opaque, grim, and nasty options / config files.  It's no wonder everyone just uses the cloud.  The poor folk trying to get a working certificate compare notes on places like stackexchange (see for example "Provide subjectAltName to openssl directly on the command line" [0], which contained the final solution for me.  Please note: the "final solution" is not a phenocide of anyone involved in OpenSSL "development").

[0] <https://security.stackexchange.com/questions/74345/provide-subjectaltname-to-openssl-directly-on-the-command-line>

The one that worked was to provide the arcane "-extfile" option at signing time, providing simply "subjectAltName=DNS:wiki.example.org" inside there (so, surprise: it is not at CSR-generation time).  The one that worked was also several answers down, with the other answers not working, and many other answers and procedures from other pages not having worked.  OpenSSL is a disaster and their developers are oblivious.

As a piece of CLI interface design, what is a nice minimal interface to make a certificate, including making a CA if necessary.  It should match current browser whims, and somehow anticipate a need to adapt to changing browser fashions later, but keep it minimal, not having anything like the full x509 complexity, and certainly not the appalling lack of interface design per openssl.  Most fields can be left empty -- there is no need to start asking for a lot of directory info when someone is trying to get a working certificate.  The domains, key, ca, and arguably ca chain are all that matter.  Maybe optional ip addresses.

On the road to that, how about a serialisation format which, instead of being an opaque blob (base64'd or whatnot), puts all the text stuff in plain text, say in yaml or similar, and just puts binary items like keys, signatures, etc, in base64.  You shouldn't have to run "openssl x509 -noout -text -in wiki.example.org.crt" just to inspect the damned thing, and given their tools' behaviour, one suspects the above of hiding certain fields unless instructed not to, etc etc.

Comments

Popular posts from this blog

the persistent idiocy of "privileged ports" on Unix

google is giving more and more 500 errors

Guernsey Waste in incorrect bag-rejection horror May 6th, 2024