Introduce verificationSuccessful boolean

This commit is contained in:
Florian Schmaus 2019-05-16 16:50:47 +02:00
parent f60e4055ec
commit 2ceadc0de1
1 changed files with 5 additions and 1 deletions

View File

@ -879,7 +879,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
verifierHostname = getXMPPServiceDomain().toString();
}
}
if (!verifier.verify(verifierHostname, sslSocket.getSession())) {
final boolean verificationSuccessful;
// Verify the TLS session.
verificationSuccessful = verifier.verify(verifierHostname, sslSocket.getSession());
if (!verificationSuccessful) {
throw new CertificateException(
"Hostname verification of certificate failed. Certificate does not authenticate "
+ getXMPPServiceDomain());