Skip to content

Commit 669dcc3

Browse files
jalberdi004Joseba Alberdialex
authored
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 <[email protected]> Co-authored-by: Alex Gaynor <[email protected]>
1 parent 3db93f1 commit 669dcc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/OpenSSL/crypto.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import calendar
12
import datetime
23

34
from base64 import b16encode
@@ -1672,7 +1673,9 @@ def set_time(self, vfy_time):
16721673
param = _lib.X509_VERIFY_PARAM_new()
16731674
param = _ffi.gc(param, _lib.X509_VERIFY_PARAM_free)
16741675

1675-
_lib.X509_VERIFY_PARAM_set_time(param, int(vfy_time.strftime("%s")))
1676+
_lib.X509_VERIFY_PARAM_set_time(
1677+
param, calendar.timegm(vfy_time.timetuple())
1678+
)
16761679
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)
16771680

16781681
def load_locations(self, cafile, capath=None):

0 commit comments

Comments
 (0)