1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +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();
}
}
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());