diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-21 19:27:05 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-21 19:27:05 +0200 |
| commit | 9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e (patch) | |
| tree | ab9b96e5265a7d5fa5ac4044d2034ede61eb72a0 /client/main.cpp | |
| parent | e28c0d9b1072c8b75ed43c09f883b1a0bd06846d (diff) | |
| download | cmix-9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e.tar.gz cmix-9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e.tar.bz2 cmix-9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e.zip | |
Added SSL connections to the client.
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(); } |
