From f053c1c53f00962ee9ca25d591d248e7695e6fa5 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 27 Feb 2013 20:54:50 -0800 Subject: change free cert postfix to be a prefix (this is required for how openvpn does common name matching) --- certs/test/unit/client_certificate_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'certs/test/unit') diff --git a/certs/test/unit/client_certificate_test.rb b/certs/test/unit/client_certificate_test.rb index bcc61cc..abb5560 100644 --- a/certs/test/unit/client_certificate_test.rb +++ b/certs/test/unit/client_certificate_test.rb @@ -9,16 +9,16 @@ class ClientCertificateTest < ActiveSupport::TestCase assert sample.to_s end - test "free cert has configured postfix" do + test "free cert has configured prefix" do sample = ClientCertificate.new(free: true) - postfix = APP_CONFIG[:free_cert_postfix] - assert sample.cert.subject.common_name.include?(postfix) + prefix = APP_CONFIG[:free_cert_prefix] + assert sample.cert.subject.common_name.starts_with?(prefix) end - test "real cert has no free cert postfix" do + test "real cert has no free cert prefix" do sample = ClientCertificate.new - postfix = APP_CONFIG[:free_cert_postfix] - assert !sample.cert.subject.common_name.include?(postfix) + prefix = APP_CONFIG[:free_cert_prefix] + assert !sample.cert.subject.common_name.starts_with?(prefix) end test "cert issuer matches ca subject" do -- cgit v1.2.3