Skip to content
Snippets Groups Projects
Commit 62b657d7 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

ConnectionManager: allow self-signed certificate

Change-Id: I10999a2126a6ee0ed1fbc0d9edcef963a6e6c261
parent 82960b3c
No related branches found
No related tags found
No related merge requests found
...@@ -1503,11 +1503,11 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert ...@@ -1503,11 +1503,11 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
top_issuer = top_issuer->issuer; top_issuer = top_issuer->issuer;
// Device certificate can't be self-signed // Device certificate can't be self-signed
if (top_issuer == crt) { /* if (top_issuer == crt) {
if (logger) if (logger)
logger->warn("Found invalid (self-signed) peer device: {}", crt->getLongId()); logger->warn("Found invalid (self-signed) peer device: {}", crt->getLongId());
return false; return false;
} } */
// Check peer certificate chain // Check peer certificate chain
// Trust store with top issuer as the only CA // Trust store with top issuer as the only CA
...@@ -1526,12 +1526,14 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert ...@@ -1526,12 +1526,14 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
return false; return false;
} }
account_id = crt->issuer->getId(); if (auto issuer = crt->issuer) {
account_id = issuer->getId();
if (logger) if (logger)
logger->warn("Found peer device: {} account:{} CA:{}", logger->warn("Found peer device: {} account:{} CA:{}",
crt->getLongId(), crt->getLongId(),
account_id, account_id,
top_issuer->getId()); top_issuer->getId());
}
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment