Ah, the problem is sudo invocation. The redirect of standard input seems to happen before privilege expansion.
Just try:
$ sudo openssl x509 -dates -noout -in /path/to/cert.pem
Ah, the problem is sudo invocation. The redirect of standard input seems to happen before privilege expansion.
Just try:
$ sudo openssl x509 -dates -noout -in /path/to/cert.pem