Skip to content

Commit

Permalink
C++ connection should fail fast if the TLS handshake fails (apache#4218)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankelly authored and merlimat committed May 6, 2019
1 parent 575bb1d commit eff2874
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pulsar-client-cpp/lib/ClientConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ void ClientConnection::handleTcpConnected(const boost::system::error_code& err,
}

void ClientConnection::handleHandshake(const boost::system::error_code& err) {
if (err) {
LOG_ERROR(cnxString_ << "Handshake failed: " << err.message());
close();
return;
}

bool connectingThroughProxy = logicalAddress_ != physicalAddress_;
SharedBuffer buffer = Commands::newConnect(authentication_, logicalAddress_, connectingThroughProxy);
// Send CONNECT command to broker
Expand Down

0 comments on commit eff2874

Please sign in to comment.