dhammond wroteI've run the script on my ovpn file generated by Sophos XG210 (SFOS 15.01.0 MR-3) and it passes the checks.
[18:52:21] drewhammond:sophos-sslvpn-checker $ ./checkcert.py cert.ovpn
Certificate #1
151106023945Z : correct date length per RFC 5280
361231023945Z : correct date length per RFC 5280
Certificate #2
Still seeing the "OpenVPN error : PolarSSL: error parsing cert certificate : X509 - The date tag or value is invalid" error on the app.
I updated the cert validation script to check for certs that don't use GMT (Zulu) time as RFC 5280 requires. Running the script now on a Sophos-generated cert, you can see that it's using a time differential (i.e. the "+0000") which the RFC explicitly forbids. The RFC wants "Zulu" time where the date ends in 'Z':
For the purposes of this profile, UTCTime values MUST be expressed in
Greenwich Mean Time (Zulu) and MUST include seconds (i.e., times are
YYMMDDHHMMSSZ), even where the number of seconds is zero.
So I'd have to say that mbedTLS/PolarSSL is properly following the standard here.
Output on Sophos cert from updated cert checker:
$ python ~/scripts/certdate.py UserCertificate.pem
=== UserCertificate.pem ===
Certificate #1
150630000000+0000 : invalid date per RFC 5280 because not in Greenwich Mean Time (Zulu) format
361231120000+0000 : invalid date per RFC 5280 because not in Greenwich Mean Time (Zulu) format
If you want to run the cert checker yourself, the script is here:
https://gist.github.com/jamesyonan/90b8b5a6a70bcc4779ffa7be66d3c6a6
More details about validity date requirements in RFC 5280:
https://tools.ietf.org/html/rfc5280#section-4.1.2.5
James