From eebe08aba43302b080c7b534a746f0f30359f370 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 28 Jan 2015 12:32:15 -0800 Subject: client certificates: allow for time units to be specified in client_cert_lifespan config option. --- test/integration/api/smtp_cert_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb index b1bfd43..2f50ef3 100644 --- a/test/integration/api/smtp_cert_test.rb +++ b/test/integration/api/smtp_cert_test.rb @@ -33,7 +33,8 @@ class SmtpCertTest < ApiIntegrationTest assert_text_response cert = OpenSSL::X509::Certificate.new(get_response.body) fingerprint = OpenSSL::Digest::SHA1.hexdigest(cert.to_der).scan(/../).join(':') - expiry = APP_CONFIG[:client_cert_lifespan].months.from_now.utc.midnight + number, unit = APP_CONFIG[:client_cert_lifespan].split(' ') + expiry = Time.now.utc.at_midnight.advance(unit.to_sym => number.to_i) expiry_string = expiry.to_date.to_s fingerprints = {fingerprint => expiry_string} assert_equal fingerprints, @user.reload.identity.cert_fingerprints -- cgit v1.2.3