From a277acf8d4536d212baf8820dc22eeb229bbf71d Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Tue, 29 Nov 2016 16:58:06 +0900 Subject: test: fix fragile test cases Fix the fragile test cases that are sensitive to the difference between Time.now.to_i and time(2). When issuing test certificates, we are typically setting the current time fetched by Time.now to the notBefore field. Time.now uses clock_gettime(2) with CLOCK_REALTIME. On the other hand, OpenSSL uses time(2) in its certificate verification code. On Linux/x86-64, time(2) is implemented not to return the adjusted 'current time' like Time.now, but to return the wall clock seconds at the last tick. This results in that time(2) called later may return an earlier time, causing the certificate verification to fail with 'certificate is not yet valid' error. So, create test certificates with notBefore