https://www.openssl.org/docs/man1.1.0/man3/ASN1_TIME_set_string.html
says:
ASN1_TIME_print() currently does not print out the time zone: it either prints out "GMT" or nothing. But all certificates complying with RFC5280 et al use GMT anyway.
t.tm_sec = (*(p++) - '0') * 10;
t.tm_sec += (*(p++) - '0');
- /* ASN1_TIME is UTC, but mktime will treat it as being in the local timezone */
+ /* ASN1_TIME is UTC, so get the UTC time */
done:
- *out = mktime(&t) + timezone;
+ *out = timegm(&t);
return 0;
}