Skip to content

Commit

Permalink
Merge "Add a log message before assert when ssl mode set fails."
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 11, 2016
2 parents 35dd4d4 + 77864d2 commit 492e560
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/xmpp/xmpp_client.cc
Expand Up @@ -82,7 +82,11 @@ XmppClient::XmppClient(EventManager *evm, const XmppChannelConfig *config)

// Verify peer has CA signed certificate
ctx->set_verify_mode(boost::asio::ssl::verify_peer, ec);
assert(ec.value() == 0);
if (ec.value() != 0) {
LOG(ERROR, "Error : " << ec.message()
<< ", while setting ssl verification mode");
exit(EINVAL);
}

ctx->load_verify_file(config->path_to_ca_cert, ec);
if (ec.value() != 0) {
Expand Down
6 changes: 5 additions & 1 deletion src/xmpp/xmpp_server.cc
Expand Up @@ -88,7 +88,11 @@ XmppServer::XmppServer(EventManager *evm, const string &server_addr,

// Verify peer has CA signed certificate
ctx->set_verify_mode(boost::asio::ssl::verify_peer, ec);
assert(ec.value() == 0);
if (ec.value() != 0) {
LOG(ERROR, "Error : " << ec.message()
<< ", while setting ssl verification mode");
exit(EINVAL);
}

ctx->load_verify_file(config->path_to_ca_cert, ec);
if (ec.value() != 0) {
Expand Down

0 comments on commit 492e560

Please sign in to comment.