For reference, the ACME client creates the following relevant files in ${LETSENCRYPT_DIR}:
${DISCOURSE_HOSTNAME}.cer: contains the issued certificateca.cer: contains the certificate chain and is somewhat confusingly namedfullchain.cer: combines the above two files
The most correct command would be:
openssl verify -untrusted ca.cer ${DISCOURSE_HOSTNAME}.cer
The existing command is a little convoluted (and is incorrect as it doesn’t actually test the chain is valid to a system root), and anything else relies on side effects or assumptions.
I’ve extended the suggested change here: