1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 03:52:06 +01:00

Introduce verificationSuccessful boolean

This commit is contained in:
Florian Schmaus 2019-05-16 16:50:47 +02:00
parent f60e4055ec
commit 2ceadc0de1

View file

@ -879,7 +879,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
verifierHostname = getXMPPServiceDomain().toString(); 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( throw new CertificateException(
"Hostname verification of certificate failed. Certificate does not authenticate " "Hostname verification of certificate failed. Certificate does not authenticate "
+ getXMPPServiceDomain()); + getXMPPServiceDomain());