summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjalberdi004 <joseba.alberdi@ehu.eus>2020-10-18 17:55:40 +0200
committerGitHub <noreply@github.com>2020-10-18 10:55:40 -0500
commit669dcc3488a4803b2c321218def6554805940c48 (patch)
tree815500fc8a8a625c46a8d71761e71cd65c445c6a
parent3db93f1ad0c3e6f0e3dc5773b492a932b4d6e84a (diff)
downloadpyopenssl-git-669dcc3488a4803b2c321218def6554805940c48.tar.gz
Fixing issue #798 (#907)
* Fixing issue #798, thanks to @reaperhulk; removing undocumented '%s' option and getting the date in a more robust way Co-authored-by: Joseba Alberdi <j.alberdi@simuneatomistics.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
-rw-r--r--src/OpenSSL/crypto.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 673da3f..11be813 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -1,3 +1,4 @@
+import calendar
import datetime
from base64 import b16encode
@@ -1672,7 +1673,9 @@ class X509Store(object):
param = _lib.X509_VERIFY_PARAM_new()
param = _ffi.gc(param, _lib.X509_VERIFY_PARAM_free)
- _lib.X509_VERIFY_PARAM_set_time(param, int(vfy_time.strftime("%s")))
+ _lib.X509_VERIFY_PARAM_set_time(
+ param, calendar.timegm(vfy_time.timetuple())
+ )
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)
def load_locations(self, cafile, capath=None):