diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp
index 7243f534123bd5a538431b5bc1b4af58c8059be5..70d48e448ef1bb268c6792d0e4ccef4e38d086a6 100644
--- a/src/connectionmanager.cpp
+++ b/src/connectionmanager.cpp
@@ -1503,11 +1503,11 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
         top_issuer = top_issuer->issuer;
 
     // Device certificate can't be self-signed
-    if (top_issuer == crt) {
+    /* if (top_issuer == crt) {
         if (logger)
             logger->warn("Found invalid (self-signed) peer device: {}", crt->getLongId());
         return false;
-    }
+    } */
 
     // Check peer certificate chain
     // Trust store with top issuer as the only CA
@@ -1526,12 +1526,14 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
         return false;
     }
 
-    account_id = crt->issuer->getId();
-    if (logger)
-        logger->warn("Found peer device: {} account:{} CA:{}",
-              crt->getLongId(),
-              account_id,
-              top_issuer->getId());
+    if (auto issuer = crt->issuer) {
+        account_id = issuer->getId();
+        if (logger)
+            logger->warn("Found peer device: {} account:{} CA:{}",
+                crt->getLongId(),
+                account_id,
+                top_issuer->getId());
+    }
     return true;
 }