aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-04-17 23:44:21 +0000
committerlloyd <[email protected]>2012-04-17 23:44:21 +0000
commitbc3c4823036c306f03c010b9d4a8f2eef6424fbf (patch)
treed8118ab2e55d17b5ded2cb91108f1611de6674e4
parent64572522281c06ab4a849b90d168e11aa78c8f03 (diff)
Only do the hostname/DNS comparison if it is set. Otherwise, we have
nothing meaningful to compare to.
-rw-r--r--src/credentials/credentials_manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/credentials/credentials_manager.cpp b/src/credentials/credentials_manager.cpp
index ed737a08f..88b653df5 100644
--- a/src/credentials/credentials_manager.cpp
+++ b/src/credentials/credentials_manager.cpp
@@ -101,7 +101,7 @@ void Credentials_Manager::verify_certificate_chain(
if(cert_chain.empty())
throw std::invalid_argument("Certificate chain was empty");
- if(!cert_chain[0].matches_dns_name(purported_hostname))
+ if(purported_hostname != "" && !cert_chain[0].matches_dns_name(purported_hostname))
throw std::runtime_error("Certificate did not match hostname");
#if 1