diff options
Diffstat (limited to 'client/main.cpp')
| -rw-r--r-- | client/main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/client/main.cpp b/client/main.cpp index bcac249..b84c3df 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -5,6 +5,7 @@ #include "logging.hpp" #include <boost/program_options.hpp> +#include <boost/filesystem/operations.hpp> #include <vector> #include <iostream> @@ -20,6 +21,7 @@ int main(int argc, char* argv[]) { desc.add_options() ("help,h", "produce help message.") ("network,n", po::value<std::vector<std::string>>()->multitoken(), "The addresses of the network nodes in order") + ("certdir", po::value<std::string>(), "Directory containing trusted certificates.") ; po::variables_map vm; @@ -46,6 +48,19 @@ int main(int argc, char* argv[]) { node_details.push_back({uri.host, uri.port}); } - CMixClient cmix_client(node_details); + std::string certdir; + if(vm.count("certdir")) { + std::string filename = vm["certdir"].as<std::string>(); + if(boost::filesystem::is_directory(filename)) { + certdir = filename; + } else { + std::cerr << "cert dir: \"" << filename << "\" is not a directory"; + return -1; + } + } + + NetworkDetails details{node_details, certdir}; + + CMixClient cmix_client(details); cmix_client.run(); } |
