Skip to content

Commit c5c1123

Browse files
Generate all unit-test certificates with CN=localhost
1 parent f5be692 commit c5c1123

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

test/remote-certificate-fixture.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,19 @@ void RequiresCertificate::AddCaFixture(const String& caFixtureName)
9595
m_CaFixtures.emplace_back(caFixtureName);
9696
}
9797

98-
void RequiresCertificate::AddCertFixture(const String& cn, const String& caFixture, const String& certFixture)
98+
void RequiresCertificate::AddCertFixture(const String& name, const String& caFixture, const String& certFixture)
9999
{
100100
auto& mts = boost::unit_test::framework::master_test_suite();
101101
boost::unit_test::decorator::base_ptr certLabel{new boost::unit_test::label{"cert"}};
102102

103103
auto* setup = boost::unit_test::make_test_case(
104-
[cn]() {
104+
[name]() {
105105
CertificateFixture certFixture;
106106
auto persistentCertsPath = CertificateFixture::m_PersistentCertsDir / "certs";
107-
auto keyFile = persistentCertsPath / (cn.GetData() + ".key");
108-
auto csrFile = persistentCertsPath / (cn.GetData() + ".csr");
109-
auto crtFile = persistentCertsPath / (cn.GetData() + ".crt");
110-
PkiUtility::NewCert(cn, keyFile.string(), csrFile.string(), "");
107+
auto keyFile = persistentCertsPath / (name.GetData() + ".key");
108+
auto csrFile = persistentCertsPath / (name.GetData() + ".csr");
109+
auto crtFile = persistentCertsPath / (name.GetData() + ".crt");
110+
PkiUtility::NewCert("localhost", keyFile.string(), csrFile.string(), "");
111111
PkiUtility::SignCsr(csrFile.string(), crtFile.string());
112112
},
113113
certFixture.GetData() + "_setup",

test/remote-certificate-fixture.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class RequiresCertificate : public CTestPropertiesBase
9595
static inline std::vector<String> m_CaFixtures;
9696

9797
static void AddCaFixture(const String& caFixtureName);
98-
static void AddCertFixture(const String& cn, const String& caFixture, const String& certFixture);
98+
static void AddCertFixture(const String& name, const String& caFixture, const String& certFixture);
9999
};
100100

101101
} // namespace icinga

0 commit comments

Comments
 (0)