diff --git a/src/LibgnutlsTLSSession.cc b/src/LibgnutlsTLSSession.cc index 386819a2..18a1309c 100644 --- a/src/LibgnutlsTLSSession.cc +++ b/src/LibgnutlsTLSSession.cc @@ -341,6 +341,9 @@ int GnuTLSSession::tlsConnect(const std::string& hostname, TLSVersion& version, commonName.assign(altName, altNameLen); } } + else { + commonName.assign(altName, altNameLen); + } } } if (!net::verifyHostname(hostname, dnsNames, ipAddrs, commonName)) {