Merge branch 'master' of https://github.com/rsdmike/rpc
This commit is contained in:
14
.github/semantic.yml
vendored
Normal file
14
.github/semantic.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
allowMergeCommits: true
|
||||
# Always validate the PR title AND all the commits
|
||||
titleAndCommits: true
|
||||
types:
|
||||
- feat
|
||||
- fix
|
||||
- docs
|
||||
- style
|
||||
- refactor
|
||||
- perf
|
||||
- test
|
||||
- build
|
||||
- ci
|
||||
- revert
|
7
args.cpp
7
args.cpp
@@ -126,4 +126,9 @@ bool args_get_info(int argc, char* argv[], std::string& info)
|
||||
bool args_get_verbose(int argc, char* argv[])
|
||||
{
|
||||
return get_arg_exists(argc, argv, "--verbose", "-v");
|
||||
}
|
||||
}
|
||||
|
||||
bool args_get_nocertcheck(int argc, char* argv[])
|
||||
{
|
||||
return get_arg_exists(argc, argv, "--nocertcheck", "-n");
|
||||
}
|
||||
|
1
args.h
1
args.h
@@ -16,5 +16,6 @@ bool args_get_cmd(int argc, char* argv[], std::string& cmd);
|
||||
bool args_get_dns(int argc, char* argv[], std::string& dns);
|
||||
bool args_get_info(int argc, char* argv[], std::string& info);
|
||||
bool args_get_verbose(int argc, char* argv[]);
|
||||
bool args_get_nocertcheck(int argc, char* argv[]);
|
||||
|
||||
#endif
|
||||
|
22
main.cpp
22
main.cpp
@@ -60,6 +60,7 @@ int main(int argc, char* argv[])
|
||||
std::string arg_dns;
|
||||
std::string arg_info;
|
||||
bool arg_verbose = false;
|
||||
bool arg_nocertcheck = false;
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
@@ -116,6 +117,13 @@ int main(int argc, char* argv[])
|
||||
arg_verbose = true;
|
||||
}
|
||||
|
||||
// no websocket server certificate verification
|
||||
if (args_get_nocertcheck(argc, argv))
|
||||
{
|
||||
arg_nocertcheck = true;
|
||||
}
|
||||
|
||||
|
||||
// Print version info
|
||||
usage_show_version();
|
||||
|
||||
@@ -160,11 +168,15 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
client_config.set_proxy(web::web_proxy(utility::conversions::to_string_t(arg_proxy)));
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// skip certificate verification if debug build
|
||||
std::cout << "Skipping certificate verification." << std::endl;
|
||||
client_config.set_validate_certificates(false);
|
||||
#endif
|
||||
|
||||
// websocket server certificate verification
|
||||
if (arg_nocertcheck)
|
||||
{
|
||||
// skip websocket server certificate verification
|
||||
std::cout << "Skipping certificate verification." << std::endl;
|
||||
client_config.set_validate_certificates(false);
|
||||
}
|
||||
|
||||
web::websockets::client::websocket_callback_client client(client_config);
|
||||
std::condition_variable cv;
|
||||
std::mutex mx;
|
||||
|
@@ -25,6 +25,7 @@ void usage_show_help()
|
||||
std::cout << "Optional:" << std::endl;
|
||||
std::cout << " -p, --proxy <addr> proxy address and port" << std::endl;
|
||||
std::cout << " -d, --dns <dns> dns suffix override" << std::endl;
|
||||
std::cout << " -n, --nocertcheck skip websocket server certificate verification" << std::endl;
|
||||
std::cout << " -v, --verbose verbose output" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Informational:" << std::endl;
|
||||
@@ -69,4 +70,4 @@ void usage_show_version()
|
||||
|
||||
std::cout << project_name << " " << PROJECT_VER << "." << std::endl;
|
||||
std::cout << "Protocol " << PROTOCOL_VERSION << "." << std::endl;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user