fgerlits commented on code in PR #1598:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1598#discussion_r1280406656
##########
libminifi/test/unit/NetUtilsTest.cpp:
##########
@@ -64,3 +65,44 @@ TEST_CASE("net::reverseDnsLookup",
"[net][dns][reverseDnsLookup]") {
CHECK(unresolvable_hostname == "2001:db8::");
}
}
+
+TEST_CASE("utils::net::getClientSslContext") {
Review Comment:
Can you add some negative tests, too? E.g. self-signed certificate,
incorrect or missing passphrase etc.
##########
libminifi/test/unit/NetUtilsTest.cpp:
##########
@@ -64,3 +65,44 @@ TEST_CASE("net::reverseDnsLookup",
"[net][dns][reverseDnsLookup]") {
CHECK(unresolvable_hostname == "2001:db8::");
}
}
+
+TEST_CASE("utils::net::getClientSslContext") {
+ TestController controller;
+ auto plan = controller.createPlan();
+
+ auto ssl_context_node = plan->addController("SSLContextService",
"ssl_context_service");
+ auto ssl_context_service =
std::dynamic_pointer_cast<minifi::controllers::SSLContextService>(ssl_context_node->getControllerServiceImplementation());
+
+ const std::filesystem::path ca_dir =
std::filesystem::path(minifi::utils::file::FileUtils::get_executable_dir()) /
"resources";
Review Comment:
Very minor, but I think `cert_dir` or `resource_dir` would be a better name,
since it contains client certs, keys and passphrases, too, not only CA
certificates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]