Set security error status on TLS cert mismatch
This commit is contained in:
parent
d2388a5a7e
commit
17cec63c14
|
@ -593,12 +593,13 @@ public class XmppConnection implements Runnable {
|
||||||
}
|
}
|
||||||
sslSocket.setEnabledProtocols(supportProtocols);
|
sslSocket.setEnabledProtocols(supportProtocols);
|
||||||
|
|
||||||
if (verifier != null
|
if (verifier != null
|
||||||
&& !verifier.verify(account.getServer().getDomainpart(),
|
&& !verifier.verify(account.getServer().getDomainpart(),
|
||||||
sslSocket.getSession())) {
|
sslSocket.getSession())) {
|
||||||
sslSocket.close();
|
account.setStatus(Account.State.SECURITY_ERROR);
|
||||||
throw new IOException("host mismatch in TLS connection");
|
sslSocket.close();
|
||||||
}
|
throw new IOException("Host mismatch in TLS connection");
|
||||||
|
}
|
||||||
tagReader.setInputStream(sslSocket.getInputStream());
|
tagReader.setInputStream(sslSocket.getInputStream());
|
||||||
tagWriter.setOutputStream(sslSocket.getOutputStream());
|
tagWriter.setOutputStream(sslSocket.getOutputStream());
|
||||||
sendStartStream();
|
sendStartStream();
|
||||||
|
|
Loading…
Reference in a new issue