diff --git a/src/jamidht/p2p.cpp b/src/jamidht/p2p.cpp
index 53c7d9819d5f61eaed3a2a3adc6409a72d2d31ef..700012263a22713610a8309d6b08ef011c02542f 100644
--- a/src/jamidht/p2p.cpp
+++ b/src/jamidht/p2p.cpp
@@ -417,6 +417,7 @@ private:
                     JAMI_WARN() << "TLS connection failure from peer " << peer_.toString();
                 ice->cancelOperations(); // This will stop current PeerChannel operations
                 cancel();
+                return false;
             } else if (state == tls::TlsSessionState::ESTABLISHED) {
                 // Connected!
                 connected_ = true;